Subversion
Typedefs | Functions

Typedefs

typedef svn_error_t *(* svn_wc_canonicalize_svn_prop_get_file_t) (const svn_string_t **mime_type, svn_stream_t *stream, void *baton, apr_pool_t *pool)
 Callback type used by svn_wc_canonicalize_svn_prop. More...
 

Functions

svn_error_tsvn_wc_prop_list2 (apr_hash_t **props, svn_wc_context_t *wc_ctx, const char *local_abspath, apr_pool_t *result_pool, apr_pool_t *scratch_pool)
 Set *props to a hash table mapping char * names onto svn_string_t * values for all the regular properties of local_abspath. More...
 
svn_error_tsvn_wc_prop_list (apr_hash_t **props, const char *path, svn_wc_adm_access_t *adm_access, apr_pool_t *pool)
 Similar to svn_wc_prop_list2() but with a svn_wc_adm_access_t / relative path parameter pair. More...
 
svn_error_tsvn_wc_get_pristine_props (apr_hash_t **props, svn_wc_context_t *wc_ctx, const char *local_abspath, apr_pool_t *result_pool, apr_pool_t *scratch_pool)
 Return the set of "pristine" properties for local_abspath. More...
 
svn_error_tsvn_wc_prop_get2 (const svn_string_t **value, svn_wc_context_t *wc_ctx, const char *local_abspath, const char *name, apr_pool_t *result_pool, apr_pool_t *scratch_pool)
 Set *value to the value of property name for local_abspath, allocating *value in result_pool. More...
 
svn_error_tsvn_wc_prop_get (const svn_string_t **value, const char *name, const char *path, svn_wc_adm_access_t *adm_access, apr_pool_t *pool)
 Similar to svn_wc_prop_get2(), but with a svn_wc_adm_access_t / relative path parameter pair. More...
 
svn_error_tsvn_wc_prop_set4 (svn_wc_context_t *wc_ctx, const char *local_abspath, const char *name, const svn_string_t *value, svn_depth_t depth, svn_boolean_t skip_checks, const apr_array_header_t *changelist_filter, svn_cancel_func_t cancel_func, void *cancel_baton, svn_wc_notify_func2_t notify_func, void *notify_baton, apr_pool_t *scratch_pool)
 Set property name to value for local_abspath, or if value is NULL, remove property name from local_abspath. More...
 
svn_error_tsvn_wc_prop_set3 (const char *name, const svn_string_t *value, const char *path, svn_wc_adm_access_t *adm_access, svn_boolean_t skip_checks, svn_wc_notify_func2_t notify_func, void *notify_baton, apr_pool_t *pool)
 Similar to svn_wc_prop_set4(), but with a svn_wc_adm_access_t / relative path parameter pair, no depth parameter, no changelist filtering (for the depth-based property setting), and no cancellation. More...
 
svn_error_tsvn_wc_prop_set2 (const char *name, const svn_string_t *value, const char *path, svn_wc_adm_access_t *adm_access, svn_boolean_t skip_checks, apr_pool_t *pool)
 Like svn_wc_prop_set3(), but without the notification callbacks. More...
 
svn_error_tsvn_wc_prop_set (const char *name, const svn_string_t *value, const char *path, svn_wc_adm_access_t *adm_access, apr_pool_t *pool)
 Like svn_wc_prop_set2(), but with skip_checks always FALSE. More...
 
svn_boolean_t svn_wc_is_normal_prop (const char *name)
 Return TRUE iff name is a 'normal' property name. More...
 
svn_boolean_t svn_wc_is_wc_prop (const char *name)
 Return TRUE iff name is a 'wc' property name.
 
svn_boolean_t svn_wc_is_entry_prop (const char *name)
 Return TRUE iff name is a 'entry' property name.
 
svn_error_tsvn_wc_canonicalize_svn_prop (const svn_string_t **propval_p, const char *propname, const svn_string_t *propval, const char *path, svn_node_kind_t kind, svn_boolean_t skip_some_checks, svn_wc_canonicalize_svn_prop_get_file_t prop_getter, void *getter_baton, apr_pool_t *pool)
 Canonicalize the value of an svn:* property propname with value propval. More...
 

Detailed Description

Typedef Documentation

◆ svn_wc_canonicalize_svn_prop_get_file_t

typedef svn_error_t*(* svn_wc_canonicalize_svn_prop_get_file_t) (const svn_string_t **mime_type, svn_stream_t *stream, void *baton, apr_pool_t *pool)

Callback type used by svn_wc_canonicalize_svn_prop.

If mime_type is non-null, it sets *mime_type to the value of SVN_PROP_MIME_TYPE for the path passed to svn_wc_canonicalize_svn_prop (allocated from pool). If stream is non-null, it writes the contents of the file to stream.

(Currently, this is used if you are attempting to set the SVN_PROP_EOL_STYLE property, to make sure that the value matches the mime type and contents.)

Since
New in 1.5.

Definition at line 6413 of file svn_wc.h.

Function Documentation

◆ svn_wc_canonicalize_svn_prop()

svn_error_t* svn_wc_canonicalize_svn_prop ( const svn_string_t **  propval_p,
const char *  propname,
const svn_string_t propval,
const char *  path,
svn_node_kind_t  kind,
svn_boolean_t  skip_some_checks,
svn_wc_canonicalize_svn_prop_get_file_t  prop_getter,
void *  getter_baton,
apr_pool_t *  pool 
)

Canonicalize the value of an svn:* property propname with value propval.

If the property is not appropriate for a node of kind kind, or is otherwise invalid, throw an error. Otherwise, set *propval_p to a canonicalized version of the property value.

The exact set of canonicalizations and checks may vary across different versions of this API. Currently:

  • svn:executable
  • svn:needs-lock
  • svn:special
    • set the value to '*'
  • svn:keywords
    • strip leading and trailing white space
  • svn:ignore
  • svn:global-ignores
  • svn:auto-props
    • add a final a newline character if missing
  • svn:externals
    • add a final a newline character if missing
    • check for valid syntax
    • check for no duplicate entries
  • svn:mergeinfo
    • canonicalize
    • check for validity

Also, unless skip_some_checks is TRUE:

  • svn:eol-style
    • strip leading and trailing white space
    • check value is recognized
    • check file content has a self-consistent EOL style (but not necessarily that it matches propval)
  • svn:mime-type
    • strip white space
    • check for reasonable syntax

The EOL-style check (if not skipped) requires access to the contents and MIME type of the target if it is a file. It will call prop_getter with getter_baton. The callback must set the MIME type and/or write the contents of the file to the given stream. If skip_some_checks is true, then prop_getter is not used and may be NULL.

path should be the path of the file in question; it is only used for error messages.

The error code on validity check failure should be specified, and

should be a single code or a very small set of possibilities.

This is not actually related to the WC, but it does need to call

svn_wc_parse_externals_description3.

Since
New in 1.5.

◆ svn_wc_get_pristine_props()

svn_error_t* svn_wc_get_pristine_props ( apr_hash_t **  props,
svn_wc_context_t wc_ctx,
const char *  local_abspath,
apr_pool_t *  result_pool,
apr_pool_t *  scratch_pool 
)

Return the set of "pristine" properties for local_abspath.

There are node states where properties do not make sense. For these cases, NULL will be returned in *props. Otherwise, a hash table will always be returned (but may be empty, indicating no properties).

If the node is locally-added, then *props will be set to NULL since pristine properties are undefined. Note: if this addition is replacing a previously-deleted node, then the replaced node's properties are not available until the addition is reverted.

If the node has been copied (from another node in the repository), then the pristine properties will correspond to those original properties.

If the node is locally-deleted, these properties will correspond to the BASE node's properties, as checked-out from the repository. Note: if this deletion is a child of a copy, then the pristine properties will correspond to that copy's properties, not any potential BASE node. The BASE node's properties will not be accessible until the copy is reverted.

Nodes that are incomplete, excluded, absent, or not present at the node's revision will return NULL in props.

If the node is not versioned, SVN_ERR_WC_PATH_NOT_FOUND will be returned.

props will be allocated in result_pool, and all temporary allocations will be performed in scratch_pool.

Since
New in 1.7.

◆ svn_wc_is_normal_prop()

svn_boolean_t svn_wc_is_normal_prop ( const char *  name)

Return TRUE iff name is a 'normal' property name.

'Normal' is defined as a user-visible and user-tweakable property that shows up when you fetch a proplist.

The function currently parses the namespace like so:

  • 'svn:wc:' ==> a wcprop, stored/accessed separately via different API.
  • 'svn:entry:' ==> an "entry" prop, shunted into the 'entries' file.

If these patterns aren't found, then the property is assumed to be Normal.

◆ svn_wc_prop_get()

svn_error_t* svn_wc_prop_get ( const svn_string_t **  value,
const char *  name,
const char *  path,
svn_wc_adm_access_t adm_access,
apr_pool_t *  pool 
)

Similar to svn_wc_prop_get2(), but with a svn_wc_adm_access_t / relative path parameter pair.

When path is not versioned, set *value to NULL.

Deprecated:
Provided for backwards compatibility with the 1.6 API.

◆ svn_wc_prop_get2()

svn_error_t* svn_wc_prop_get2 ( const svn_string_t **  value,
svn_wc_context_t wc_ctx,
const char *  local_abspath,
const char *  name,
apr_pool_t *  result_pool,
apr_pool_t *  scratch_pool 
)

Set *value to the value of property name for local_abspath, allocating *value in result_pool.

If no such prop, set *value to NULL. name may be a regular or wc property; if it is an entry property, return the error SVN_ERR_BAD_PROP_KIND. wc_ctx is used to access the working copy.

If local_abspath is not a versioned path, return SVN_ERR_WC_PATH_NOT_FOUND

Since
New in 1.7.

◆ svn_wc_prop_list()

svn_error_t* svn_wc_prop_list ( apr_hash_t **  props,
const char *  path,
svn_wc_adm_access_t adm_access,
apr_pool_t *  pool 
)

Similar to svn_wc_prop_list2() but with a svn_wc_adm_access_t / relative path parameter pair.

Deprecated:
Provided for backwards compatibility with the 1.6 API.

◆ svn_wc_prop_list2()

svn_error_t* svn_wc_prop_list2 ( apr_hash_t **  props,
svn_wc_context_t wc_ctx,
const char *  local_abspath,
apr_pool_t *  result_pool,
apr_pool_t *  scratch_pool 
)

Set *props to a hash table mapping char * names onto svn_string_t * values for all the regular properties of local_abspath.

Allocate the table, names, and values in result_pool. If the node has no properties, then an empty hash is returned. Use wc_ctx to access the working copy, and scratch_pool for temporary allocations.

If the node does not exist, SVN_ERR_WC_PATH_NOT_FOUND is returned.

Since
New in 1.7.

◆ svn_wc_prop_set()

svn_error_t* svn_wc_prop_set ( const char *  name,
const svn_string_t value,
const char *  path,
svn_wc_adm_access_t adm_access,
apr_pool_t *  pool 
)

Like svn_wc_prop_set2(), but with skip_checks always FALSE.

Deprecated:
Provided for backward compatibility with the 1.1 API.

◆ svn_wc_prop_set2()

svn_error_t* svn_wc_prop_set2 ( const char *  name,
const svn_string_t value,
const char *  path,
svn_wc_adm_access_t adm_access,
svn_boolean_t  skip_checks,
apr_pool_t *  pool 
)

Like svn_wc_prop_set3(), but without the notification callbacks.

Since
New in 1.2.
Deprecated:
Provided for backwards compatibility with the 1.5 API.

◆ svn_wc_prop_set3()

svn_error_t* svn_wc_prop_set3 ( const char *  name,
const svn_string_t value,
const char *  path,
svn_wc_adm_access_t adm_access,
svn_boolean_t  skip_checks,
svn_wc_notify_func2_t  notify_func,
void *  notify_baton,
apr_pool_t *  pool 
)

Similar to svn_wc_prop_set4(), but with a svn_wc_adm_access_t / relative path parameter pair, no depth parameter, no changelist filtering (for the depth-based property setting), and no cancellation.

Since
New in 1.6.
Deprecated:
Provided for backwards compatibility with the 1.6 API.

◆ svn_wc_prop_set4()

svn_error_t* svn_wc_prop_set4 ( svn_wc_context_t wc_ctx,
const char *  local_abspath,
const char *  name,
const svn_string_t value,
svn_depth_t  depth,
svn_boolean_t  skip_checks,
const apr_array_header_t *  changelist_filter,
svn_cancel_func_t  cancel_func,
void *  cancel_baton,
svn_wc_notify_func2_t  notify_func,
void *  notify_baton,
apr_pool_t *  scratch_pool 
)

Set property name to value for local_abspath, or if value is NULL, remove property name from local_abspath.

Use wc_ctx to access local_abspath.

name may be a regular property or a "wc property". If name is an "entry property", return the error SVN_ERR_BAD_PROP_KIND (even if skip_checks is TRUE).

If name is a "wc property", then just update the WC DAV cache for local_abspath with name and value. In this case, depth must be svn_depth_empty.

The rest of this description applies when name is a regular property.

If name is a name in the reserved "svn:" name space, and value is non-null, then canonicalize the property value and check the property name and value as documented for svn_wc_canonicalize_svn_prop(). skip_checks controls the level of checking as documented there.

Return an error if the canonicalization or the check fails. The error will be either SVN_ERR_ILLEGAL_TARGET (if the property is not appropriate for path), or SVN_ERR_BAD_MIME_TYPE (if name is "svn:mime-type", but value is not a valid mime-type).

That is not currently right – several other errors can be raised.

depth follows the usual semantics for depth.

changelist_filter is an array of const char * changelist names, used as a restrictive filter on items whose properties are set; that is, don't set properties on any item unless it's a member of one of those changelists. If changelist_filter is empty (or altogether NULL), no changelist filtering occurs.

If cancel_func is non-NULL, then it will be invoked (with the cancel_baton value passed) during the processing of the property set (i.e. when depth indicates some amount of recursion).

For each file or directory operated on, notify_func will be called with its path and the notify_baton. notify_func may be NULL if you are not interested in this information.

Use scratch_pool for temporary allocation.

Note
If the caller is setting both svn:mime-type and svn:eol-style in separate calls, and skip_checks is false, there is an ordering dependency between them, as the validity check for svn:eol-style makes use of the current value of svn:mime-type.

The error code on validity check failure should be specified, and

should be a single code or a very small set of possibilities.

Since
New in 1.7.