views:

162

answers:

2

We've got a pretty complicated repository here, and I'm trying to get the most out of our recent switch to Subversion. We generally have things setup like this:

parent_dir (unversioned)
->module1_dir (versioned)
->module2_dir (versioned)
->module3_dir (versioned)
->etc

And so forth. Where modules1-x are generally various modules all of the same branch. It is a relatively common scenario to need to modify code in say module1 (the server) and module2 (the client). Previously under CVS, I would just manually check in each module's changes separately. What I would like to be able to do is to commit both my server and client changes to each (changes in each of two different modules (or perhaps more modules)) simultaneously.

Is there anyway to do this in Subversion (and specifically in Tortoise SVN/Windows)? If I just navigate to that parent_dir, select the folders and do commit, the commit dialog comes up and even lists all my files, but the actual commit fails saying:

Error 'D:\parent_dir' is not a working copy

Seems like I'm perhaps only a step or two away from making this work, but not quite sure what I need to do. Oh, and we aren't going to be changing that directory structure anytime soon, so please don't suggest that as a possibility. Also, please ask a followup questions if what I'm asking for isn't clear. Thanks in advance.

Bonus points: is there a way I can commit changes to multiple modules to multiple branches simultaneously? E.g. I make a client + server change that needs to go into the 1.0 and the 2.0 branches both.

+1  A: 

Do module1, module2, and module3 have a common parent in the repository? If so, you could just check out that parent directory. (granted you could end up with a lot of extra files in your working copy that aren't relevant)

Dashogun
Nope, they don't have a common parent. That would definitely make this a whole bunch easier.
Morinar
They do have a common parent - the root of the repository. If you can stand to re-locate your checked out directories, you can do a sparse checkout from the root, and only get the files and directories you need.
Steve Jessop
And if you can't relocate them, you might be able to do that anyway, then use filesystem junctions to link the place they are now, to the place they need to be in the sparse checkout.
Steve Jessop
Hmm... that's not a bad idea at all. It would definitely be a fair amount of work as there is a LOT of stuff living under the root, but could definitely be a workable fall back solution.
Morinar
With the command line tool you can do a sparse checkout with "svn co -N", where you get only the root directory. You can then "svn up" only the directories and files you want to check out. They'll still be in the same hierarchy as in the repo, but you won't have the extra files at least. YMMV with Tortoise.
markpasc
I forgot to come back and answer this, but this is exactly what I did. I checked out the top level only of the branch and then dropped the .svn folder into the folder I was already using. Worked like a charm.
Morinar
A: 

Interesting. I'd never tried it with Tortoise before - it lists the files (as you said) but won't let you select/deselect them for commit. I don't know if there is a way round this using Tortoise, but a small script and the use of a command line SVN client like Slik SVN would do the job.

anon
Sure. We use Slik SVN for our automated ANT builds, so I already have that installed. The script wouldn't be that complicated, but I'd lose the ease of use that comes from the Tortoise GUI, which would definitely make me sad.
Morinar