Reputation: 3000
I am new to svn and need to do a lot of merging from trunk to a branch we are working from. This is the sequence of svn commmands I take to merge
svn up
svn mergeinfo --show-revs eligible branch trunk (branch and trunk are actually svn urls)
I get the lowest revision of the eligible revisions from branch and the latest trunk revision, then do an svn merge.
svn merge -r lowest_eligible:latest_trunk trunk_url .
During the merge there are a few conflicts. However, they are not related to any changes we have made in the branch so I'm a little confused why they are conflicts. Any ideas? Anyway, I always just choose, theirs-full to resolve it
Finally, I need to do svn resolve before committing
svn resolve --accept working -R .
I have two questions. Is this the best sequence of commands to perform a merge from trunk to branch?
The merge tends to take a while so I would like to just leave it merging and let svn automatically resolve the conflict to theirs-full. Is there a way to do this?
Upvotes: 6
Views: 14927
Reputation: 9311
Usually, merging should be much simpler - especially if you are only merging from trunk to branch. In that case, just make sure that
A) you have no uncommitted changes in your branch working copy, and B) that you have a current version of the branch (which you were already doing by doing an 'svn up')
If you're ready to merge, just execute
svn merge ^/trunk
in your branch working copy.
As for the conflicts: Sometimes svn botches the merge diff and reports conflicts where there are none. A good three-way merge tool such as kdiff3 can help wonders. Other than that, I recommend to NOT use automatic conflict resolution, as most conflicts will not grow easier to solve by just avoiding their resolution. Using the process described above, you should at least be able to avoid all unnecessary conflicts.
Upvotes: 3
Reputation: 97280
svn mergeinfo --show-revs eligible trunk
(first parameter is SOURCE of merge, second - TARGET /default "."/, i.e your WC)As final result, your periodical sync-merge process will be single command inside WC of branch
svn merge <URL-OF-TRUNK> --accept "theirs-conflict"
Upvotes: 4