Thursday, April 3, 2008

Do not do this with SVN!!

I had same copy of code at 2 locations in svn. I checked out one version(say A) and edited. And wanted to put the same copy to the other version(say B). So I checked out from B to another location and copied the working copy from A to B. And i started working on B. I committed... checked out.... no problems were detected until I checked out the code for a deployment from svn version of B. It was not update!!!
Guess what? As I copied version working copy of A to B. All the svn files came with A.
So I've been working inside a B svn copy but actually committing them to svn copy of A.

So if you ever wanted to update one svn copy to match another. Use export to export latest code and then copy them back to not up to date svn checkout!!!

3 comments:

Wathsala Vithanage said...

Forget about .svn? it contains all the information related to your SVN repository. When you do this next time do not forget to swap the .svn directories as well.

Dilan Anuruddha said...

Yep! that is the source of the problem. Export kinda f solution for it!

Gaveen said...

Or, more sensibly do away with SVN and switch to Git. ;)

If you used git, you could've easily created a new branch (svn also can), work on it and merge "easily" back (svn can't).

If you are stuck with SVN repos, you still can use svn with "git svn", do branching/merging and your actual work, then commit back to SVN ("git svn dcommit") like you never knew Git :) I do it all the time.

Since Git makes version controlling so easy, I'm pretty much on Git for everything, including presentations and documents.