[Svnmerge] [PATCH] Use bi-directional property merge code for uni-directional merges

Blair Zajac blair at orcaware.com
Fri Dec 8 10:17:45 PST 2006


I found a case where I'm getting merge conflicts on the svnmerge-integrated 
property with unidirectional merges and the code that merges svnmerge-integrated 
for bi-directional merges handles fixes this issue, so I'm considering applying 
the below patch.

Here's the recipe.  It makes a trunk and two branches, a qa and a production 
branch, where the production branch is copied from the qa branch.

The branches are made before svnmerge's properties are set up.

If nobody has any issues, I'll commit this change.

Regards,
Blair

-- 
Blair Zajac, Ph.D.
<blair at orcaware.com>
http://www.orcaware.com/svn/





rm -fr repos wc
svnadmin create repos
svn co file://`pwd`/repos wc
cd wc
svn mkdir trunk tags branches
svn ci -m ''
touch trunk/foo
svn add trunk/foo
svn ci -m ''
svn cp trunk branches/qa
svn commit -m ''
svn cp branches/qa branches/production
svn commit -m ''

cd branches/qa
svnmerge.py init
svn commit -F svnmerge-commit-message.txt

cd ../production
svnmerge.py init
svn commit -F svnmerge-commit-message.txt

cd ../../trunk
echo hello > foo
svn ci -m ''

cd ../branches/qa
svnmerge.py merge
svn commit -F svnmerge-commit-message.txt

cd ../production

# This gets a conflict
svnmerge merge

# This does not conflict
svnmerge -b merge




--- svnmerge.py (revision 22612)
+++ svnmerge.py (working copy)
@@ -1153,14 +1153,12 @@
      old_merge_props = branch_props
      merge_metadata = logs[opts["source-url"]].merge_metadata()
      for start,end in minimal_merge_intervals(revs, phantom_revs):
+        # Merge props
+        new_merge_props = merge_metadata.get(start-1)
+        if new_merge_props != old_merge_props:
+            set_merge_props(branch_dir, new_merge_props)
+            old_merge_props = new_merge_props

-        # Set merge props appropriately if bidirectional support is enabled
-        if opts["bidirectional"]:
-          new_merge_props = merge_metadata.get(start-1)
-          if new_merge_props != old_merge_props:
-              set_merge_props(branch_dir, new_merge_props)
-              old_merge_props = new_merge_props
-
          if not record_only:
              # Do the merge
              svn_command("merge -r %d:%d %s %s" % \



More information about the Svnmerge mailing list