tags:

views:

690

answers:

3

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
+2  A: 

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.

Gonzalo
Are you saying that despite the help listing -R as a valid option, the above paragraph _a recursive attempt will set the property only on the file children of the directory_ overrides this and -R is therefore or not valid?
adam straughan
Yes, that's what I gather from the help. In *nix you could use `find . -name \*.bob | xargs svn propset ....` to achieve what you want, but no idea how to do that on windows without cygwin.
Gonzalo
A: 

Given that there is ambiguity over the docs for what -R does (or doesn't do) as pointed out by Gonzalo I've used this batch file instead of trying to get svn to do what I want

D:>type applyProps.cmd
@echo off
for /r . %%X in (*.bob) do (
svn propset svn:keywords "Author Id HeadURL Revision" "%%X"
)
adam straughan
A: 

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...

Aron