Skip to main content

svn_client_revprop_set2

Function svn_client_revprop_set2 

Source
pub unsafe extern "C" fn svn_client_revprop_set2(
    propname: *const c_char,
    propval: *const svn_string_t,
    original_propval: *const svn_string_t,
    URL: *const c_char,
    revision: *const svn_opt_revision_t,
    set_rev: *mut svn_revnum_t,
    force: svn_boolean_t,
    ctx: *mut svn_client_ctx_t,
    pool: *mut apr_pool_t,
) -> *mut svn_error_t
Expand description

Set @a propname to @a propval on revision @a revision in the repository represented by @a URL. Use the authentication baton in @a ctx for authentication, and @a pool for all memory allocation. Return the actual rev affected in @a *set_rev. A @a propval of @c NULL will delete the property.

If @a original_propval is non-NULL, then just before setting the new value, check that the old value matches @a original_propval; if they do not match, return the error #SVN_ERR_RA_OUT_OF_DATE. This is to help clients support interactive editing of revprops: without this check, the window during which the property may change underneath the user is as wide as the amount of time the user spends editing the property. With this check, the window is reduced to a small, constant amount of time right before we set the new value. (To check that an old value is still non-existent, set @a original_propval->data to NULL, and @a original_propval->len is ignored.) If the server advertises #SVN_RA_CAPABILITY_ATOMIC_REVPROPS, the check of @a original_propval is done atomically.

Note: the representation of “property is not set” in @a original_propval differs from the representation in other APIs (such as svn_fs_change_rev_prop2() and svn_ra_change_rev_prop2()).

If @a force is TRUE, allow newlines in the author property.

If @a propname is an svn-controlled property (i.e. prefixed with #SVN_PROP_PREFIX), then the caller is responsible for ensuring that the value UTF8-encoded and uses LF line-endings.

Note that unlike its cousin svn_client_propset3(), this routine doesn’t affect the working copy at all; it’s a pure network operation that changes an unversioned property attached to a revision. This can be used to tweak log messages, dates, authors, and the like. Be careful: it’s a lossy operation.

@a ctx->notify_func2 and @a ctx->notify_baton2 are the notification functions and baton which are called upon successful setting of the property.

Also note that unless the administrator creates a pre-revprop-change hook in the repository, this feature will fail.

@since New in 1.6.