tags:

views:

157

answers:

2

I have two svn branches checked out, "b1" and "b2". I would like to merge all of my commits from the "b1" branch onto the "b2" branch. I have tried something like

svn merge -r HEAD:HEAD b1 b2

but it does nothing. I am sure I have this command wrong but I can't find good documentation on it. I would like to do this on the client side and not create a third branch.

Update

I also should mention that I am using SVN 1.4.4 which doesn't support the reintegrate option.

Any ideas?

Thanks!

+2  A: 

From the reference page for svn merge in the Subversion book:

$ svn merge --reintegrate \
            http://svn.example.com/repos/calc/branches/my-calc-branch
--- Merging differences between repository URLs into '.':
U    button.c
U    integer.c
U    Makefile
 U   .

$ # build, test, verify, ...

$ svn commit -m "Merge my-calc-branch back into trunk!"
Sending        .
Sending        button.c
Sending        integer.c
Sending        Makefile
Transmitting file data ..
Committed revision 391.

Edit: OK, so you're using an old version of Subversion. In that case, see Merging a Whole Branch to Another in version 1.4 of the book.

Daniel Pryden
i can't find good documentation on what exactly reintegrate does. i am merging one branch to another, not one branch to the trunk. and as specified in the question, this will be done on 2 working copies of the branches (think local directories and not svn server URL's). can you update your answer to reflect these concerns?
Tony
also i have svn version 1.4.4 which doesn't seem to support the reintegrate option. since that seems to be a shortcut for a longer command, i would appreciate the longer version. thanks!
Tony
+2  A: 

Your problem is with the -r flag. You have to specify a range of revisions. So for example:

svn merge -r 13:HEAD b1 b2

To figure out the correct revision number you can do:

svn log --stop-on-copy b1

log will then only list commits which happened on b1. The smallest revision number you'll see will be your pick.

I've never used this form though. I always ensured that I was actively on branch b2, and then did:

svn merge -r 13:HEAD url://to/branch/b1
exhuma