*edited 23-10-2008* : merging from trunk to branch requires [trunk_url] too : Thanks you, Michael.
I assumed that you have read my (Branching & merging in Subversion 1.0)
This post will emphasis you only the different between 1.0 and 1.5. Both functions were improved in 1.5 is much more easier. If you’re using older version : “It’s worth to switch to 1.5 !!”
- Keeping a Branch in sync (No manually tracking any more!!)
- From trunk to branch : $branch_wc$ svn merge [trunk_url]
- Subversion automatically track which version has been merged into the branch. You don’t have to specify the revisions range (changeset) anymore !!
- From feature branch to trunk : $trunk_wc$ svn merge –reintegrate [branch_url]
- As mentioned in last post, your branch contains some part of the trunk’s code from merging
- –reintegrate option tell Subversion to carefully replicate only those changes unique to your branch.
- When the branch is already reintegrated, it can’t continue developing on this code line. You should use “svn delete [branch_url]’. Don’t worry the history of branch is still existed.
- Again, don’t forget to commit !!
- In your branch working copy, type “svn prpget svn:info”
- You’ll see output like this “/trunk 341-390”. It specified which revision has been merged and from which development line.
- try “svn mergeinfo [trunk_url]” This will show you which revision you have merged in to the branch.
- “svn mergeinfo [trunk_url] –show-revs eligible” will tell you the opposite info, which revision in trunk that hasn’t been merged to branch. (Eligible to merge)
- Common usages
- Undo change
- In version 1.0 “svn merge -r 303:302”
- Now, You can use “svn merge -c -303” too
- Resurrecting deleted item
- In version 1.0 “svn copy –-revision [rev_no] [url] [wc]”
- Now you can use “svn copy [file_url]@[rev_no] [wc]/[filename]”
- For example, “svn copy http://svn.example.com/repos/calc/trunk/real.c@807 ./real.c”
- you can change [wc] (working copy dir) to url, like this “svn copy http://svn.example.com/repos/calc/trunk/real.c@807 http://svn.example.com/repos/calc/trunk/”
- Undo change