Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Recursive svn propset

Tags:

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
like image 493
Adam Straughan Avatar asked Nov 19 '09 16:11

Adam Straughan


2 Answers

Actually -R is recursive. For example:

svn propset svn:eol-style 'LF' -R *

This will work on all subfolders as well. However:

svn propset svn:eol-style 'LF' -R *.php

...will only work on php files within the current folder, regardless of the -R. Adding:

svn propset svn:eol-style 'LF' -R */*.php

Will work on subfolders one level down. Adding extra /-s will go another level and so on...

I'm really not sure how to specify (or if it is even possible to do so) that it should be filtered based on file name AND recursive. Regardless, experimenting can't hurt, since the modifications are local and can always be thrown away by reverting...

like image 148
Aron Avatar answered Nov 21 '22 13:11

Aron


From svn help propset:

The svn:keywords, svn:executable, svn:eol-style, svn:mime-type and
svn:needs-lock properties cannot be set on a directory. A non-recursive
attempt will fail, and a recursive attempt will set the property only on the file children of the directory.

like image 22
Gonzalo Avatar answered Nov 21 '22 14:11

Gonzalo