diff the relevant paths until the + and – shoe the operations you want to perform to your working copy
change into the equivalent directory on your working copy and replace the word “diff” with the word “merge”
That’s it.
Seems like a bit of a short blog post for something that a lot of people find painful, so here’s what I actually did, in more depth.
Example
- I had the branch I’d been working on checked out. I committed all changes and triple-checked that I had done that
- I ran
svn log --stop-on-copy
and noted the revision number which was the commit where I created the branch - Next I took a checkout of trunk so that I could break things in my own space
- I changed into the new checkout and from the root of it, figured out what I should be diffing, piped it to more and read through the output to make sure I really was applying what I thought I was applying.
svn diff -r[branch create rev]:HEAD http://path/to/repo/branch/ | more
- Then I ran the same command again but without the |more and with diff now replaced by merge
- I then checked my working copy, if there were conflicts I’d have resolved them, checked the system still worked, that sort of thing
- Committed my changes
I hope that helps – the same principle applies whether you are applying one fix or many fixes to trunk or branches – the key is to think about what it is you want to merge, and make sure the diff looks right. You can play with the diff without breaking anything for as long as you need to (which today was just as well because the first thing I tried was completely not the right one!) and once it looks plausible – merge those changes in and then untangle anything which has gone wrong from there. Hope this helps!