Recursive svn propset

Viewed 23263

I'm trying to recursively add properties to all files with a wildcard.

File structure as below

D:>dir *.bob /s/b
D:\Source\key-test\test.bob
D:\Source\key-test\test2.bob
D:\Source\key-test\sub\test3.bob

properties so far (none)

D:>svn propget svn:keywords -R *.bob

try a recursive set (note test3.bob is missing)

D:>svn propset svn:keywords "Author HeadURL Id Revision" -R *.bob
property 'svn:keywords' set on 'test.bob'
property 'svn:keywords' set on 'test2.bob'

change to sub and make sure we can set the prop (ok)

D:>cd sub
D:>svn propset svn:keywords "Author HeadURL Id Revision" -R *.bob
property 'svn:keywords' set on 'test3.bob'

Anyone know what's up with -R, I've also tried --recursive?

Cheers,

adam

D:>svn --version
svn, version 1.6.6 (SlikSvn:tag/1.6.6@40358) WIN32
   compiled Nov  3 2009, 15:31:43
5 Answers

Just recursively changed properties on .xml files from application/xml to text/xml and was trying to see if there was a better way to do it. I couldn't find one, but stumbled across this question. Though it's old, this is the most succinct way I found:

find /<root_dir> -print | grep '.<extension>' | xargin svn propset svn:<property> <new_ property_value> $@

find -print recursively lists all files in all sub directories of <root_dir> with their full path starting with <root_dir>

grep '.<extension>' receives the piped output from find as input and filters it based on the extension you're looking for

xargin allows you to execute a command that may not work smoothly with piped input in stdin, which can be referenced with $@

For example, my exact command was

find /config -print | grep '.xml' | xargin svn propset svn:mime-type text/xml $@

Note <root_dir> must be an immediate sub-directory of your present working directory

Related