Extending Cornerstone with User Properties

What is a User Property?

A property is a named value associated with a file or folder under version control.

Subversion defines a set of standard properties (svn:ignore, svn:keywords, etc.) that have intrinsic meaning to both Cornerstone and Subversion.

You can also associate your own data with version-controlled items through the use of user properties (also known as custom properties).

A user property is just a property with a non-standard name.

Cornerstone and Subversion attach no meaning to the existence of user properties, or their contents. You (or your custom tools) are responsible for assigning, changing and retrieving these properties as required.

See the Subversion documentation included with Cornerstone for information on svn’s proplist, propget and propset commands that you can use in your own scripts to retrieve and modify the values of user properties.

Why User Properties?

User properties are version-controlled in the same way as standard properties and therefore represent a great way to attach user-defined data to items under version control.

The properties associated with a file or folder are automatically retrieved when an item is checked out or updated. And property modifications are transferred back to the repository when an item is committed.

Property Names

A property may have any name, provided that the following criteria are met:

Case-Sensitivity

Property names are case-sensitive, i.e. permissions, Permissions and PERMISSIONS identify three distinct properties.

Prefixes

Subversion’s standard properties are identified with a “svn:” prefix. Consider prefixing your user property names with a prefix specific to your organization, as this will help you identify them more easily.

Property Values

Property values may be textual or binary. It is completely up to you what you store in your properties—Cornerstone and Subversion will make no attempt to interpret their contents.

Properties can be used to store large values (e.g. a file’s entire contents) but this practice is not recommended.

As a rule, properties should contain small snippets of information, generally no larger than 10 kilobytes. Consider storing larger data as a file under version control.

Other Topics