Attached is a patch to svnmerge.py that avoids property conflicts for
both merged revisions (as per my prior patch) as well as blocked
revisions. This patch obsoletes the one at http://tinyurl.com/3c229c.
The patch simply avoids conflicts be removing the integrated/blocked
properties altogether before calling merge, and then resets them to
their known values after the merge is complete.
Please use the earlier patch from Dustin (which was never committed)
to test this code. It can be found here:
http://tinyurl.com/39bwwj
[[[
Prevent spurious conflicts on the merge and blocked property
when the source branch contains merge property information for
other branches i.e. a transitive merge A -> B -> C is executed.
Previously, this caused a property conflict because the initial
value on the source branch did not match the initial value on
the target branch.
This patch also prevents extra merge property information from
uninitialized branches being merged into the target. If merging
to those other branches was never initialized on the target by
the user, then the user probably does not expect to see that
information. Note that if that information *was* initialized by
the user, then the user is attempting to do graph-based merging
i.e. A -> B -> C -> A which is currently unsupported.
* contrib/client-side/svnmerge.py:
(action_merge): Before each merge, clear the integrated/blocked
properties. Reset these properties to known values after the
merge is complete.
Patch by: Raman Gupta <[EMAIL PROTECTED]>
Review by: ?
]]]
Cheers,
Raman Gupta
Index: svnmerge.py
===================================================================
--- svnmerge.py (revision 25647)
+++ svnmerge.py (working copy)
@@ -25,7 +25,7 @@
# John Belmonte <john at neggie dot net> - metadata and usability
# improvements
# Blair Zajac <blair at orcaware dot com> - random improvements
-# Raman Gupta <rocketraman at fastmail dot fm> - bidirectional merging
+# Raman Gupta <rocketraman at fastmail dot fm> - bidirectional and transitive merging
# support
#
# $HeadURL$
@@ -1166,20 +1166,17 @@
# We try to keep the number of merge operations as low as possible,
# because it is faster and reduces the number of conflicts.
old_merge_props = branch_props
+ old_block_props = get_block_props(branch_dir)
merge_metadata = logs[opts["source-url"]].merge_metadata()
for start,end in minimal_merge_intervals(revs, phantom_revs):
-
- # 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:
+ # Clear merge/blocked properties to avoid spurious property conflicts
+ set_merge_props(branch_dir, {})
+ set_block_props(branch_dir, {})
# Do the merge
svn_command("merge --force -r %d:%d %s %s" % \
(start - 1, end, opts["source-url"], branch_dir))
+ # TODO: to support graph merging, add logic to merge the property meta-data manually
# Write out commit message if desired
if opts["commit-file"]:
@@ -1202,6 +1199,8 @@
merged_revs = merged_revs | revs | reflected_revs | phantom_revs
branch_props[opts["source-path"]] = str(merged_revs)
set_merge_props(branch_dir, branch_props)
+ # Reset the blocked revs
+ set_block_props(branch_dir, old_block_props)
def action_block(branch_dir, branch_props):
"""Block revisions."""
_______________________________________________
Svnmerge mailing list
[email protected]
http://www.orcaware.com/mailman/listinfo/svnmerge