Home > Uncategorized > How to manually perform an svn merge

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 }’

Categories: Uncategorized Tags:
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: