svnmerge workflow
Asked Answered
J

1

6

How are you using svnmerge for merging and branching in svn?

Specifically I ask because I have started using svnmerge to track a specific branch in a project I work on. I did svnmerge merge and ended up with lots of strange files like .merge-left, .merge-right, .working. Now, I want to see how others use it to end up learning how I can revert my changes and apply a merge the best proper way.

Judgemade answered 4/11, 2009 at 13:11 Comment(2)
Specifically I ask because I have started using svnmerge to track a specific branch in a project I work on. I did svnmerge merge and ended up with lots of strange files like .merge-left, .merge-right, .working. Now, I want to see how others use it to end up learning how I can revert my changes and apply a merge the best proper way.Serbocroatian
Does https://mcmap.net/q/343082/-differences-between-svn-merge-left-right-amp-working-files-after-conflicts make more sense?Prude
C
21

If you are seing the merge-left/right/working files then it means that there's been a conflict in a merge you've tried to apply. This means that the same section of code has been changed in different ways on the source branch (the branch you've merged from) and the destination branch (the branch you're merging to).

  • 'file.py.merge-left.rxxx` shows the merging result taking the left side of the conflict
  • 'file.py.merge-right.ryyy` shows the merging result taking the right side of the conflict
  • 'file.py.working` shows your unchanged working copy
  • 'file.py` shows SVNs attempts to merge both

See the SVN Book for more information on conflicts. To resolve them you need to look at the left and right files and work out how best to combine the conflicting changes. If you have an SVN GUI such as TortoiseSVN or SmartSVN then you should be able to open the client's conflict viewer. I'd highly recommend that over trying to do it from the raw text files. If you're an emacs user than ediff is great for resolving conflicts too.

Once you're happy with the change then you need to mark the file as 'resolved' in SVN, which allows you to check the file in.

Contractive answered 4/11, 2009 at 13:30 Comment(5)
I'd also recommend Araxis Merge as a very good commercial merge tool. Winmerge is pretty decent as a free tool.Contractive
For Windows users check out Beyond Compare 3 for helping merge, not free but well worth the price!Sacking
In my case file.merge-left.r140 and file.merge-right.r142 appear with the .working file. The show in Pending files and are marked "New" to be checked into the repository. What does that suppose to mean? I check in the rest of the files except these.Selfcongratulation
Did SVN tell you there was a tree conflict? I suspect that's what happened here. This occurs when a file has been independently added in two different branches.Contractive
Your answer seems to suggest .merge-right and .working should agree for the most of the cases (when we start from an unchanged checkout of the "right") but that does not agree with my observation.Sullins

© 2022 - 2024 — McMap. All rights reserved.