11.07.2015 Views

Version Control with Subversion - Login

Version Control with Subversion - Login

Version Control with Subversion - Login

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Advanced Topicschanges occurs as part of your typical commit and update operations—you don't have tochange your basic processes to accommodate them.<strong>Subversion</strong> has reserved the set of properties whose names begin <strong>with</strong> svn:as its own. While there are only a handful of such properties in use today, youshould avoid creating custom properties for your own needs whose names begin<strong>with</strong> this prefix. Otherwise, you run the risk that a future release of <strong>Subversion</strong>will grow support for a feature or behavior driven by a property of thesame name but <strong>with</strong> perhaps an entirely different interpretation.Properties show up elsewhere in <strong>Subversion</strong>, too. Just as files and directories may havearbitrary property names and values attached to them, each revision as a whole may havearbitrary properties attached to it. The same constraints apply—human-readable namesand anything-you-want binary values. The main difference is that revision properties arenot versioned. In other words, if you change the value of, or delete, a revision property,there's no way, <strong>with</strong>in the scope of <strong>Subversion</strong>'s functionality, to recover the previousvalue.<strong>Subversion</strong> has no particular policy regarding the use of properties. It asks only that younot use property names that begin <strong>with</strong> the prefix svn:. That's the namespace that it setsaside for its own use. And <strong>Subversion</strong> does, in fact, use properties—both the versionedand unversioned variety. Certain versioned properties have special meaning or effectswhen found on files and directories, or they house a particular bit of information about therevisions on which they are found. Certain revision properties are automatically attached torevisions by <strong>Subversion</strong>'s commit process, and they carry information about the revision.Most of these properties are mentioned elsewhere in this or other chapters as part of themore general topics to which they are related. For an exhaustive list of <strong>Subversion</strong>'s predefinedproperties, see the section called “<strong>Subversion</strong> Properties”.In this section, we will examine the utility—both to users of <strong>Subversion</strong> and to <strong>Subversion</strong>itself—of property support. You'll learn about the property-related svn subcommands andhow property modifications affect your normal <strong>Subversion</strong> workflow.Why Properties?Just as <strong>Subversion</strong> uses properties to store extra information about the files, directories,and revisions that it contains, you might also find properties to be of similar use. You mightfind it useful to have a place close to your versioned data to hang custom metadata aboutthat data.Say you wish to design a web site that houses many digital photos and displays them <strong>with</strong>captions and a datestamp. Now, your set of photos is constantly changing, so you'd like tohave as much of this site automated as possible. These photos can be quite large, so as iscommon <strong>with</strong> sites of this nature, you want to provide smaller thumbnail images to your sitevisitors.Now, you can get this functionality using traditional files. That is, you can have your image123.jpgand an image123-thumbnail.jpg side by side in a directory. Or if youwant to keep the filenames the same, you might have your thumbnails in a different directory,such as thumbnails/image123.jpg. You can also store your captions and datestampsin a similar fashion, again separated from the original image file. But the problemhere is that your collection of files multiplies <strong>with</strong> each new photo added to the site.Now consider the same web site deployed in a way that makes use of <strong>Subversion</strong>'s fileproperties. Imagine having a single image file, image123.jpg, <strong>with</strong> properties set on thatfile that are named caption, datestamp, and even thumbnail. Now your working copydirectory looks much more manageable—in fact, it looks to the casual browser like thereare nothing but image files in it. But your automation scripts know better. They know thatthey can use svn (or better yet, they can use the <strong>Subversion</strong> language bindings—see thesection called “Using the APIs”) to dig out the extra information that your site needs to dis-43

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!