svn_wc_add_repos_file4

Function svn_wc_add_repos_file4 

Source
pub unsafe extern "C" fn svn_wc_add_repos_file4(
    wc_ctx: *mut svn_wc_context_t,
    local_abspath: *const c_char,
    new_base_contents: *mut svn_stream_t,
    new_contents: *mut svn_stream_t,
    new_base_props: *mut apr_hash_t,
    new_props: *mut apr_hash_t,
    copyfrom_url: *const c_char,
    copyfrom_rev: svn_revnum_t,
    cancel_func: svn_cancel_func_t,
    cancel_baton: *mut c_void,
    scratch_pool: *mut apr_pool_t,
) -> *mut svn_error_t
Expand description

Add a file to a working copy at @a local_abspath, obtaining the text-base’s contents from @a new_base_contents, the wc file’s content from @a new_contents, its unmodified properties from @a new_base_props and its actual properties from @a new_props. Use @a wc_ctx for accessing the working copy.

The unmodified text and props normally come from the repository file represented by the copyfrom args, see below. The new file will be marked as copy.

@a new_contents and @a new_props may be NULL, in which case the working copy text and props are taken from the base files with appropriate translation of the file’s content.

@a new_contents must be provided in Normal Form. This is required in order to pass both special and non-special files through a stream.

@a wc_ctx must contain a write lock for the parent of @a local_abspath.

If @a copyfrom_url is non-NULL, then @a copyfrom_rev must be a valid revision number, and together they are the copyfrom history for the new file.

The @a cancel_func and @a cancel_baton are a standard cancellation callback, or NULL if no callback is needed. @a notify_func and @a notify_baton are a notification callback, and (if not NULL) will be notified of the addition of this file.

Use @a scratch_pool for temporary allocations.

§This function is very redundant with svn_wc_add(). Ideally,

we’d merge them, so that svn_wc_add() would just take optional new_props and optional copyfrom information. That way it could be used for both ‘svn add somefilesittingonmydisk’ and for adding files from repositories, with or without copyfrom history.

The problem with this Ideal Plan is that svn_wc_add() also takes care of recursive URL-rewriting. There’s a whole comment in its doc string about how that’s really weird, outside its core mission, etc, etc. So another part of the Ideal Plan is that that functionality of svn_wc_add() would move into a separate function.

@since New in 1.7.