views:

1890

answers:

5

I tried using svn ci dir/a dir/b -m "my comment" but this doesn't work. I also used svn ci dir/a/* dir/b/* -m "my comment" and it too doesn't work.

I know you can specify multiple files, but how can I tell subversion to check in all modified files in these folders? I mainly want to do this so that all my changes get in on one revision. I can checkin one directory at a time, but this ends up giving me different revisions for each directory..

A: 
svn add dir/a
svn add dir/b
svn commit

Though, more likely, you're thinking:

svn add dir/*
svn commit
Autocracy
The directories are already in the repository, I just want to check in the files that are modified on my local.
MCRivers
If they're already added, simply doing "svn commit" will cover it.
Autocracy
A: 

I think you only have 1 option: check in the containing directory - the one that has both these as subdirs.

If they're not organised like that already (ie they're both top-level directories in the repo), then there's not a lot you can do - the svn commands work on a single directory only.

gbjbaanb
They both share a common top level directory but that directory is rather...huge, with many other child folders.
MCRivers
fair enough, that just means that svn will take longer to search through them to find all files that need committing. If none do, then its surprisingly quick. Try it using svn status to see (status will take longer than ci BTW)
gbjbaanb
svn commit will work on multiple directories, but only if they are all in the same working copy. If there is stuff you don't want, you can use subversion 1.5's sparse directories to make a smaller, more concise working copy.
crashmstr
A: 

This is easy if you check-out from a higher level folder for where a and b are. So if your working copy is "dir" and a and b have changes, commit "dir" to commit changes to both. I do this all of the time.

Edit:
To commit more than one folder, you will need for them to be in the same working copy.

If you are worried about having too much to process, you could try a sparse checkout with only the folders you need, and then you could just commit the base directory or the subdirectories as needed without the overhead of the other projects.

Sparse Directories Information

crashmstr
+1  A: 

You may need to specify what does "but this doesn't work" mean because it works fine here:

D:\Projects>svn commit -m 'test1' test\aaa "test\aaa bbb ccc"
Sending        test\aaa\aaa222\xxx.txt
Sending        test\aaa bbb ccc\aaa.txt
Transmitting file data ..
Committed revision 8.

D:\Projects>
Milen A. Radev
I wonder if they are separate working copies? Would that fail?
crashmstr
Yes, it will fail. OTOH we don't know the layout of the OP's working copies, so it may or may not be the the reason why it "doesn't work".
Milen A. Radev
C:\zoo>svn ci c:\zoo\tiger c:\zoo\lion -m "my comment"svn: 'C:\zoo' is not a working copythis is the error I get. It will work if I just pass it one directory, but when I give it a second directory it errors out.
MCRivers
see my update re: sparse directories. You can have a working copy that only has the projects you are concerned about, and it would make it easy to commit changes to both at the same time.
crashmstr
A: 

Consider using svn:externals property for checking out part of the repository. You can pick and choose which directories to get, then commit to multiple destinations in a single step. We've been using this approach for a while with great success.

GregC
I am talking about TortoiseSVN client...
GregC
I'd strongly suggest looking at sparse directories in SVN now, if you're using Tortoise, then its as simple as you can get - its great.
gbjbaanb