pub unsafe extern "C" fn svn_wc_add4(
wc_ctx: *mut svn_wc_context_t,
local_abspath: *const c_char,
depth: svn_depth_t,
copyfrom_url: *const c_char,
copyfrom_rev: svn_revnum_t,
cancel_func: svn_cancel_func_t,
cancel_baton: *mut c_void,
notify_func: svn_wc_notify_func2_t,
notify_baton: *mut c_void,
scratch_pool: *mut apr_pool_t,
) -> *mut svn_error_t
Expand description
Put @a local_abspath under version control by registering it as addition or copy in the database containing its parent. The new node is scheduled for addition to the repository below its parent node.
- If the node is already versioned, it MUST BE the root of a separate working copy from the same repository as the parent WC. The new node and anything below it will be scheduled for addition inside the parent working copy as a copy of the original location. The separate working copy will be integrated by this step. In this case, which is only used by code like that of “svn cp URL@rev path” @a copyfrom_url and @a copyfrom_rev MUST BE the url and revision of @a local_abspath in the separate working copy.
2a) If the node was not versioned before it will be scheduled as a local addition or 2b) if @a copyfrom_url and @a copyfrom_rev are set as a copy of that location. In this last case the function doesn’t set the pristine version (of a file) and/or pristine properties, which callers should handle via different APIs. Usually it is easier to call svn_wc_add_repos_file4() (### or a possible svn_wc_add_repos_dir()) than using this variant.
If @a local_abspath does not exist as file, directory or symlink, return #SVN_ERR_WC_PATH_NOT_FOUND.
If @a local_abspath is an unversioned directory, record @a depth on it; otherwise, ignore @a depth. (Use #svn_depth_infinity unless you exactly know what you are doing, or you may create an unexpected sparse working copy)
If @a cancel_func is non-NULL, call it with @a cancel_baton at various points during the operation. If it returns an error (typically #SVN_ERR_CANCELLED), return that error immediately.
When the @a local_abspath has been added, then @a notify_func will be called (if it is not @c NULL) with the @a notify_baton and the path.
@note Case 1 is deprecated. Consider doing a WC-to-WC copy instead. @note For case 2a, prefer svn_wc_add_from_disk().
@since New in 1.7.