Archive

Archive for February, 2010

How to manually perform an svn merge

The other daya co-worker of mine was having trouble performing an svn merge between two branches the other day and getting lots of tree conflicts. Tree conflicts were introduced in 1.6, and since then merges with have not worked so well in TortoiseSVN.

So rather then trying to use tortoise we dropped to the command line and created a patch manually:
First we located the revision number where the branch was created
svn log –stop-on-copy http://server/svn/myapp/branches/featurexyz

now we write all changesets to patch file
svn diff -r 34574 http://server/svn/myapp/branches/featurexyz > changes.patch

Then apply patch using tortoise svn resolving any conflicts if necessary.

Note that the patch does not include any binary files which you must copy manually.
But, the patch file lists all the binary files at the top of the file so just open it with a text editor to get a list of them. If you have cygwin or msys the following would probably do the trick, xargs into svn export perhaps:
grep -B4 octet-stream changes.patch | grep Index: | awk ‘{ print $2 }’

Advertisements
Categories: Uncategorized Tags: