Monday, May 19, 2008

Subversion Question

I have a question about Subversion that I can't quite coax Google into answering. Is there any problem with copying an existing working copy and using that instead of running svn checkout to create a new working copy?

You might want to do this if checkouts from your Subversion repository are very slow, see. I tried it out and it seems to work, but I wonder if there are any hidden pitfalls to this method. If you have any ideas please comment.

4 comments:

willert said...

Not really an authorative answer, because I totally lack any understanding of the svn internals, but in my experience there is no harm at all in doing so, as long as you keep all permissions and stuff intact (cp -av works well enough in *nix).

svn keeps all info about the repo in its checkout tree, which helps in this situation but is a major PITA in almost all other circumstances. You might also want to have a look at svk, kind of a distributed front-end for svn repos. Fast as can be (after your local mirror is in place) and solves some of the usability problems with svn quite beautifully. Also, its hard to beat having a full history (even the full repos) of your trees when working offline or on the road, or in case of disaster recovery when your servers go down.

svk copies even tend to beat svn checkouts in terms of disk space, especially if you do a lot of branching.

HTH, Sebastian

piyo said...

Agree with willert.

A short cp -av or rsync or xcopy will do the trick. Subversion doesn't save the working parent path in its internals at all. I even copy .svn directories with no problems.

(insert git advocacy here)

handyman5 said...

For a definitive answer, do a small experiment. Check out two instances of the same repository and 'diff' them. If there are no changes, then copy away.

Bryan said...

Thanks for the quick answers!

I tried the diff suggestion and the only differences between two working copies are some timestamps in .svn/entries files. Running svn info in each returns the exact same thing.

With that and the vote of confidence from willert and piyo I think I'll go for it (when I can't use git, that is ;-)