Pagine

Thursday 9 March 2017

SVN tutorial n 31 - propset

The "svn propset" commands sets a property name to a property value on files, directories and/or revisions. The synopsis is:
 svn propset PROPNAME [PROPVAL | -F VALFILE] PATH...
or
 svn propset PROPNAME --revprop -r REV [PROPVAL | -F VALFILE] [TARGET]

Examples:

Set the MIME type for a file:
 svn propset svn:mime-type image/jpeg file.jpg 
 property 'svn:mime-type' set on 'file.jpg'
On a Unix system, if you want a file to have the executable permission set:
 svn propset svn:executable ON myscript.sh
 property 'svn:executable' set on 'myscript.sh'
Perhaps you have an internal policy to set certain properties for the benefit of your coworkers:
 svn propset owner bob file.txt
 property 'owner' set on 'file.txt'
If you made a mistake in a log message for a particular revision and want to change it, use --revprop and set svn:log to the new log message:
 svn propset --revprop -r 99 svn:log "A comment"
 property 'svn:log' set on repository revision '99'
Or, if you don't have a working copy, you can provide a URL:
 svn propset --revprop -r 99 svn:log "A comment" http://mysvnrepo/svn/myproject/trunk
 property 'svn:log' set on repository revision '99'
Lastly, you can tell propset to take its input from a file. You could even use this to set the contents of a property to something binary:
 svn propset owner-pic -F file.jpg file.txt 
 property 'owner-pic' set on 'file.txt'

No comments:

Post a Comment