tags:

views:

1356

answers:

3

I want to do this so that I can say something like, svn mv *.php php-folder/, but it does not seem to be working. Is it even possible? No mention of it is made on the relevant page in the svn book.

Example output of svn mv *.php php-folder/ :
svn: Client error in parsing arguments

Being able to move a whole file system would be a plus, so if any answers given could try to include that ability, that'd be cool.

Thanks in advance!

A: 

If you're in the correct checked out directory, I don't see why it wouldn't work? Your shell should expand the *.php to a list of php files, and svn move accepts multiple sources as arguments.

zigdon
Where do you see svn move accepting more than one source argument ?
Thomas Vander Stichele
From 'svn help move':move (mv, rename, ren): Move and/or rename something in working copy or repository.usage: move SRC... DSTWhen moving multiple sources, they will be added as children of DST,which must be a directory.
zigdon
That's new in Subversion 1.5, which many people haven't upgraded to yet. Obviously, stopsineman is one of them, or he wouldn't have gotten the error in the first place.
cjm
+2  A: 

Not sure about svn itself, but either your shell should be able to expand that wildcard and svn can take multiple source arguments, or you can use something like

for file in *.php; do svn mv $file php-folder/; done

in a bash shell, for example.

sirprize
+5  A: 

svn move only moves one file at a time. Your best bet is a shell loop. In Bash, try

for f in *.php ; do svn mv $f php-folder/; done

On Windows, that's

for %f in (*.php) do svn mv %f php-folder/

Edit: Starting with Subversion 1.5, svn mv accepts multiple source files, so your original command would work. The shell loop is only needed for svn 1.4.x and earlier. (Of course, the shell loop will still work with 1.5; it just isn't necessary.)

cjm
Can this be easily expanded for the traversing of a whole file hierarchy? Is this something that git does easily?
Tim Visher