[Svnmerge] [PATCH] Handle transitive merging property conflicts forboth merged/blocked revs
Piet-Hein Peeters
piet-hein.peeters at philips.com
Fri Jul 6 02:51:32 PDT 2007
Hello Raman,
I tried to patch svnmerge.py, but it was not completely succesfull:
patch svnmerge.py < c:\temp\svnmergepy.patch
patching file `svnmerge.py'
Hunk #1 succeeded at 25 with fuzz 1.
Hunk #2 FAILED at 1166.
Hunk #3 succeeded at 1182 with fuzz 2 (offset -17 lines).
1 out of 3 hunks FAILED -- saving rejects to svnmerge.py.rej
I attached the svnmerge.py.rej file. Could you please help me with this?
Or even better can you tell me where to get the already patched svnmerge.py
script.
Regards,
Piet-Hein Peeters
Software Configuration Manager
HI / PII
Philips Medical Systems
Room QV-136
Veenpluis 4-6
5684 PC Best
The Netherlands
Tel: +31 40 2762016
(See attached file: svnmerge.py.rej)
To
Svnmerge <svnmerge at orcaware.com>
cc
Raman Gupta
<rocketraman at fastmai Subject
l.fm> [Svnmerge] [PATCH] Handle
transitive merging property
Sent by: conflicts forboth
svnmerge-bounces+pie merged/blocked revs
t-hein.peeters=phili Classification
ps.com at orcaware.com
07/06/2007 03:02 AM
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 <rocketraman at fastmail.fm>
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
Svnmerge at orcaware.com
http://www.orcaware.com/mailman/listinfo/svnmerge
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/svnmerge/attachments/20070706/bb1dc33c/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: graycol.gif
Type: image/gif
Size: 105 bytes
Desc: not available
URL: </pipermail/svnmerge/attachments/20070706/bb1dc33c/attachment-0006.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pic00108.gif
Type: image/gif
Size: 1255 bytes
Desc: not available
URL: </pipermail/svnmerge/attachments/20070706/bb1dc33c/attachment-0007.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ecblank.gif
Type: image/gif
Size: 45 bytes
Desc: not available
URL: </pipermail/svnmerge/attachments/20070706/bb1dc33c/attachment-0008.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: svnmerge.py.rej
Type: application/octet-stream
Size: 1935 bytes
Desc: not available
URL: </pipermail/svnmerge/attachments/20070706/bb1dc33c/attachment-0002.obj>
More information about the Svnmerge
mailing list