Subversion
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Modules | Data Structures | Macros | Typedefs | Enumerations | Functions
Properties management utilities

Modules

 Visible properties
 Visible properties.
 
 Invisible properties
 WC props are props that are invisible to users: they're generated by an RA layer, and stored in secret parts of .svn/.
 
 Revision properties
 These are reserved properties attached to a "revision" object in the repository filesystem.
 
 Ephemeral transaction properties
 These are reserved properties attached to a "transaction" object in the repository filesystem in advance of the pre-commit hook script running on the server, but then automatically removed from the transaction before its promotion to a new revision.
 

Data Structures

struct  svn_prop_t
 A general in-memory representation of a single property. More...
 
struct  svn_prop_inherited_item_t
 A structure to represent inherited properties. More...
 

Macros

#define SVN_PROP_PREFIX   "svn:"
 All Subversion property names start with this. More...
 

Typedefs

typedef struct svn_prop_t svn_prop_t
 A general in-memory representation of a single property. More...
 
typedef struct
svn_prop_inherited_item_t 
svn_prop_inherited_item_t
 A structure to represent inherited properties. More...
 
typedef enum svn_prop_kind svn_prop_kind_t
 Subversion distinguishes among several kinds of properties, particularly on the client-side. More...
 

Enumerations

enum  svn_prop_kind {
  svn_prop_entry_kind,
  svn_prop_wc_kind,
  svn_prop_regular_kind
}
 Subversion distinguishes among several kinds of properties, particularly on the client-side. More...
 

Functions

svn_prop_tsvn_prop_dup (const svn_prop_t *prop, apr_pool_t *pool)
 Return a duplicate of prop, allocated in pool. More...
 
apr_array_header_t * svn_prop_array_dup (const apr_array_header_t *array, apr_pool_t *pool)
 Duplicate an array of svn_prop_t items using pool. More...
 
apr_array_header_t * svn_prop_hash_to_array (const apr_hash_t *hash, apr_pool_t *pool)
 Given a hash (keys const char * and values const svn_string_t) of properties, returns an array of svn_prop_t items using pool. More...
 
apr_hash_t * svn_prop_array_to_hash (const apr_array_header_t *properties, apr_pool_t *result)
 Given an array of svn_prop_t items, return a hash mapping const char * property names to const svn_string_t * values. More...
 
apr_hash_t * svn_prop_hash_dup (const apr_hash_t *hash, apr_pool_t *pool)
 Creates a deep copy of hash (keys const char * and values const svn_string_t *) in pool. More...
 
const char * svn_prop_get_value (const apr_hash_t *properties, const char *prop_name)
 Return the value of property prop_name as it is in properties, with values const svn_string_t. More...
 
svn_prop_kind_t svn_property_kind2 (const char *prop_name)
 Return the property kind of a property named prop_name. More...
 
svn_prop_kind_t svn_property_kind (int *prefix_len, const char *prop_name)
 Return the prop kind of a property named prop_name, and (if prefix_len is non-NULL) set *prefix_len to the length of the prefix of prop_name that was sufficient to distinguish its kind. More...
 
svn_boolean_t svn_prop_is_svn_prop (const char *prop_name)
 Return TRUE iff prop_name represents the name of a Subversion property. More...
 
svn_boolean_t svn_prop_has_svn_prop (const apr_hash_t *props, apr_pool_t *pool)
 Return TRUE iff props has at least one property whose name represents the name of a Subversion property, in the sense of svn_prop_is_svn_prop(). More...
 
svn_boolean_t svn_prop_is_boolean (const char *prop_name)
 Return TRUE iff prop_name is a Subversion property whose value is interpreted as a boolean. More...
 
svn_boolean_t svn_prop_is_known_svn_rev_prop (const char *prop_name)
 Return TRUE iff prop_name is in the "svn:" name space and is a known revision property ("svn:log" or "svn:date", e.g.). More...
 
svn_boolean_t svn_prop_is_known_svn_node_prop (const char *prop_name)
 Return TRUE iff prop_name is in the "svn:" name space and is a known versioned property that is allowed on a file and/or on a directory ("svn:eol-style", "svn:ignore", or "svn:mergeinfo", e.g.). More...
 
svn_boolean_t svn_prop_is_known_svn_file_prop (const char *prop_name)
 Return TRUE iff prop_name is in the "svn:" name space and is a known versioned property that is allowed on a file ("svn:eol-style" or "svn:mergeinfo", e.g.). More...
 
svn_boolean_t svn_prop_is_known_svn_dir_prop (const char *prop_name)
 Return TRUE iff prop_name is in the "svn:" name space and is a known versioned property that is allowed on a directory ("svn:ignore" or "svn:mergeinfo", e.g.). More...
 
svn_boolean_t svn_prop_needs_translation (const char *prop_name)
 If prop_name requires that its value be stored as UTF8/LF in the repository, then return TRUE. More...
 
svn_error_tsvn_categorize_props (const apr_array_header_t *proplist, apr_array_header_t **entry_props, apr_array_header_t **wc_props, apr_array_header_t **regular_props, apr_pool_t *pool)
 Given a proplist array of svn_prop_t structures, allocate three new arrays in pool. More...
 
svn_error_tsvn_prop_diffs (apr_array_header_t **propdiffs, const apr_hash_t *target_props, const apr_hash_t *source_props, apr_pool_t *pool)
 Given two property hashes (const char *name -> const svn_string_t *value), deduce the differences between them (from source_props -> target_props). More...
 
svn_boolean_t svn_prop_name_is_valid (const char *prop_name)
 Return TRUE iff prop_name is a valid property name. More...
 

Detailed Description

Macro Definition Documentation

#define SVN_PROP_PREFIX   "svn:"

All Subversion property names start with this.

Definition at line 344 of file svn_props.h.

Typedef Documentation

A structure to represent inherited properties.

Since
New in 1.8.

Subversion distinguishes among several kinds of properties, particularly on the client-side.

There is no "unknown" kind; if there's nothing special about a property name, the default category is svn_prop_regular_kind.

typedef struct svn_prop_t svn_prop_t

A general in-memory representation of a single property.

Most of the time, property lists will be stored completely in hashes. But sometimes it's useful to have an "ordered" collection of properties, in which case we use an array of these structures.

Also: sometimes we want a list that represents a set of property changes, and in this case, an apr_hash_t won't work – there's no way to represent a property deletion, because we can't store a NULL value in a hash. So instead, we use these structures.

Enumeration Type Documentation

Subversion distinguishes among several kinds of properties, particularly on the client-side.

There is no "unknown" kind; if there's nothing special about a property name, the default category is svn_prop_regular_kind.

Enumerator
svn_prop_entry_kind 

In .svn/entries, i.e., author, date, etc.

svn_prop_wc_kind 

Client-side only, stored by specific RA layer.

svn_prop_regular_kind 

Seen if user does "svn proplist"; note that this includes some "svn:" props and all user props, i.e.

ones stored in the repository fs.

Definition at line 159 of file svn_props.h.

Function Documentation

svn_error_t* svn_categorize_props ( const apr_array_header_t *  proplist,
apr_array_header_t **  entry_props,
apr_array_header_t **  wc_props,
apr_array_header_t **  regular_props,
apr_pool_t *  pool 
)

Given a proplist array of svn_prop_t structures, allocate three new arrays in pool.

Categorize each property and then create new svn_prop_t structures in the proper lists. Each new svn_prop_t structure's fields will point to the same data within proplist's structures.

Callers may pass NULL for each of the property lists in which they are uninterested. If no props exist in a certain category, and the property list argument for that category is non-NULL, then that array will come back with ->nelts == 0.

apr_array_header_t* svn_prop_array_dup ( const apr_array_header_t *  array,
apr_pool_t *  pool 
)

Duplicate an array of svn_prop_t items using pool.

Since
New in 1.3.
apr_hash_t* svn_prop_array_to_hash ( const apr_array_header_t *  properties,
apr_pool_t *  result 
)

Given an array of svn_prop_t items, return a hash mapping const char * property names to const svn_string_t * values.

Warning
The behaviour on svn_prop_t objects with a NULL svn_prop_t.value member is undefined.
Since
New in 1.7.
svn_error_t* svn_prop_diffs ( apr_array_header_t **  propdiffs,
const apr_hash_t *  target_props,
const apr_hash_t *  source_props,
apr_pool_t *  pool 
)

Given two property hashes (const char *name -> const svn_string_t *value), deduce the differences between them (from source_props -> target_props).

Set propdiffs to a new array of svn_prop_t structures, with one entry for each property that differs, including properties that exist in source_props or target_props but not both. The value field of each entry is that property's value from target_props or NULL if that property only exists in source_props.

Allocate the array from pool. Allocate the contents of the array from pool or by reference to the storage of the input hashes or both.

For note, here's a quick little table describing the logic of this routine:

source_props    target_props      event
------------    ------------      -----
value = foo     value = NULL      Deletion occurred.
value = foo     value = bar       Set occurred (modification)
value = NULL    value = baz       Set occurred (creation) 
svn_prop_t* svn_prop_dup ( const svn_prop_t prop,
apr_pool_t *  pool 
)

Return a duplicate of prop, allocated in pool.

No part of the new structure will be shared with prop.

Since
New in 1.3.
const char* svn_prop_get_value ( const apr_hash_t *  properties,
const char *  prop_name 
)

Return the value of property prop_name as it is in properties, with values const svn_string_t.

If prop_name is not in properties or properties is NULL, return NULL.

Since
New in 1.7.
svn_boolean_t svn_prop_has_svn_prop ( const apr_hash_t *  props,
apr_pool_t *  pool 
)

Return TRUE iff props has at least one property whose name represents the name of a Subversion property, in the sense of svn_prop_is_svn_prop().

Since
New in 1.5.
apr_hash_t* svn_prop_hash_dup ( const apr_hash_t *  hash,
apr_pool_t *  pool 
)

Creates a deep copy of hash (keys const char * and values const svn_string_t *) in pool.

Since
New in 1.6.
apr_array_header_t* svn_prop_hash_to_array ( const apr_hash_t *  hash,
apr_pool_t *  pool 
)

Given a hash (keys const char * and values const svn_string_t) of properties, returns an array of svn_prop_t items using pool.

Since
New in 1.5.
svn_boolean_t svn_prop_is_boolean ( const char *  prop_name)

Return TRUE iff prop_name is a Subversion property whose value is interpreted as a boolean.

Since
New in 1.5.
svn_boolean_t svn_prop_is_known_svn_dir_prop ( const char *  prop_name)

Return TRUE iff prop_name is in the "svn:" name space and is a known versioned property that is allowed on a directory ("svn:ignore" or "svn:mergeinfo", e.g.).

This will return FALSE for any property name that is not known by this version of the library, even though the name may be known to other (for example, later) Subversion software.

Since
New in 1.8.
svn_boolean_t svn_prop_is_known_svn_file_prop ( const char *  prop_name)

Return TRUE iff prop_name is in the "svn:" name space and is a known versioned property that is allowed on a file ("svn:eol-style" or "svn:mergeinfo", e.g.).

This will return FALSE for any property name that is not known by this version of the library, even though the name may be known to other (for example, later) Subversion software.

Since
New in 1.8.
svn_boolean_t svn_prop_is_known_svn_node_prop ( const char *  prop_name)

Return TRUE iff prop_name is in the "svn:" name space and is a known versioned property that is allowed on a file and/or on a directory ("svn:eol-style", "svn:ignore", or "svn:mergeinfo", e.g.).

This will return FALSE for any property name that is not known by this version of the library, even though the name may be known to other (for example, later) Subversion software.

Since
New in 1.8.
svn_boolean_t svn_prop_is_known_svn_rev_prop ( const char *  prop_name)

Return TRUE iff prop_name is in the "svn:" name space and is a known revision property ("svn:log" or "svn:date", e.g.).

This will return FALSE for any property name that is not known by this version of the library, even though the name may be known to other (for example, later) Subversion software.

Since
New in 1.8.
svn_boolean_t svn_prop_is_svn_prop ( const char *  prop_name)

Return TRUE iff prop_name represents the name of a Subversion property.

That is, any property name in Subversion's name space for versioned or unversioned properties, regardless whether the particular property name is recognized.

svn_boolean_t svn_prop_name_is_valid ( const char *  prop_name)

Return TRUE iff prop_name is a valid property name.

For now, "valid" means the ASCII subset of an XML "Name". XML "Name" is defined at http://www.w3.org/TR/REC-xml#sec-common-syn

Since
New in 1.5.
svn_boolean_t svn_prop_needs_translation ( const char *  prop_name)

If prop_name requires that its value be stored as UTF8/LF in the repository, then return TRUE.

Else return FALSE. This is for users of libsvn_client or libsvn_fs, since it their responsibility to do this translation in both directions. (See svn_subst_translate_string()/svn_subst_detranslate_string() for help with this task.)

svn_prop_kind_t svn_property_kind ( int *  prefix_len,
const char *  prop_name 
)

Return the prop kind of a property named prop_name, and (if prefix_len is non-NULL) set *prefix_len to the length of the prefix of prop_name that was sufficient to distinguish its kind.

Deprecated:
Provided for backward compatibility with the 1.7 API.
svn_prop_kind_t svn_property_kind2 ( const char *  prop_name)

Return the property kind of a property named prop_name.

Since
New in 1.8.