11.07.2015 Views

Version Control with Subversion - Login

Version Control with Subversion - Login

Version Control with Subversion - Login

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Advanced Topicsproperty 'copyright' set on 'calc/button.c'$But we've been touting the flexibility that <strong>Subversion</strong> offers for your property values. And ifyou are planning to have a multiline textual, or even binary, property value, you probablydo not want to supply that value on the command line. So the svn propset subcommandtakes a --file (-F) option for specifying the name of a file that contains the new propertyvalue.$ svn propset license -F /path/to/LICENSE calc/button.cproperty 'license' set on 'calc/button.c'$There are some restrictions on the names you can use for properties. A property namemust start <strong>with</strong> a letter, a colon (:), or an underscore (_); after that, you can also use digits,hyphens (-), and periods (.). 1In addition to the propset command, the svn program supplies the propedit command.This command uses the configured editor program (see the section called “Config”) to addor modify properties. When you run the command, svn invokes your editor program on atemporary file that contains the current value of the property (or that is empty, if you areadding a new property). Then, you just modify that value in your editor program until it representsthe new value you wish to store for the property, save the temporary file, and thenexit the editor program. If <strong>Subversion</strong> detects that you've actually changed the existingvalue of the property, it will accept that as the new property value. If you exit your editor<strong>with</strong>out making any changes, no property modification will occur:$ svn propedit copyright calc/button.c ### exit the editor <strong>with</strong>out changesNo changes to property 'copyright' on 'calc/button.c'$We should note that, as <strong>with</strong> other svn subcommands, those related to properties can acton multiple paths at once. This enables you to modify properties on whole sets of files <strong>with</strong>a single command. For example, we could have done the following:$ svn propset copyright '(c) 2006 Red-Bean Software' calc/*property 'copyright' set on 'calc/Makefile'property 'copyright' set on 'calc/button.c'property 'copyright' set on 'calc/integer.c'…$All of this property adding and editing isn't really very useful if you can't easily get thestored property value. So the svn program supplies two subcommands for displaying thenames and values of properties stored on files and directories. The svn proplist commandwill list the names of properties that exist on a path. Once you know the names of the propertieson the node, you can request their values individually using svn propget. This commandwill, given a property name and a path (or set of paths), print the value of the propertyto the standard output stream.$ svn proplist calc/button.cProperties on 'calc/button.c':copyrightlicense$ svn propget copyright calc/button.c1 If you're familiar <strong>with</strong> XML, this is pretty much the ASCII subset of the syntax for XML "Name".45

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

Saved successfully!

Ooh no, something went wrong!