[Pkg-bazaar-commits] ./bzr/unstable r824: - Merge3.find_sync_regions yields just a 6-tuple, not a tuple of tuples
Martin Pool
mbp at sourcefrog.net
Fri Apr 10 08:21:09 UTC 2009
------------------------------------------------------------
revno: 824
committer: Martin Pool <mbp at sourcefrog.net>
timestamp: Tue 2005-07-05 17:32:22 +1000
message:
- Merge3.find_sync_regions yields just a 6-tuple, not a tuple of tuples
modified:
bzrlib/merge3.py
bzrlib/selftest/testmerge3.py
-------------- next part --------------
=== modified file 'bzrlib/merge3.py'
--- a/bzrlib/merge3.py 2005-07-05 07:24:16 +0000
+++ b/bzrlib/merge3.py 2005-07-05 07:32:22 +0000
@@ -82,12 +82,13 @@
The regions in between can be in any of three cases:
conflicted, or changed on only one side.
"""
+
def find_sync_regions(self):
"""Return a list of sync regions, where both descendents match the base.
- Generates a list of ((base1, base2), (a1, a2), (b1, b2)).
+ Generates a list of (base1, base2, a1, a2, b1, b2).
"""
from difflib import SequenceMatcher
aiter = iter(SequenceMatcher(None, self.base, self.a).get_matching_blocks())
@@ -122,9 +123,9 @@
assert self.base[intbase:intend] == self.b[bsub:bend]
- yield ((intbase, intend),
- (asub, aend),
- (bsub, bend))
+ yield (intbase, intend,
+ asub, aend,
+ bsub, bend)
# advance whichever one ends first in the base text
if (abase + alen) < (bbase + blen):
=== modified file 'bzrlib/selftest/testmerge3.py'
--- a/bzrlib/selftest/testmerge3.py 2005-07-05 07:19:12 +0000
+++ b/bzrlib/selftest/testmerge3.py 2005-07-05 07:32:22 +0000
@@ -29,7 +29,9 @@
[(0, 2)])
self.assertEquals(list(m3.find_sync_regions()),
- [((0, 2), (0, 2), (0, 2))])
+ [(0, 2,
+ 0, 2,
+ 0, 2)])
@@ -44,9 +46,10 @@
[(0, 1), (1, 2)])
+
self.assertEquals(list(m3.find_sync_regions()),
- [((0, 1), (0, 1), (0, 1)),
- ((1, 2), (2, 3), (1, 2))])
+ [(0, 1, 0, 1, 0, 1),
+ (1, 2, 2, 3, 1, 2)])
class InsertClash(TestBase):
@@ -60,8 +63,8 @@
[(0, 1), (1, 2)])
self.assertEquals(list(m3.find_sync_regions()),
- [((0, 1), (0, 1), (0, 1)),
- ((1, 2), (2, 3), (2, 3))])
+ [(0, 1, 0, 1, 0, 1),
+ (1, 2, 2, 3, 2, 3)])
@@ -76,8 +79,8 @@
[(0, 1), (2, 3)])
self.assertEquals(list(m3.find_sync_regions()),
- [((0, 1), (0, 1), (0, 1)),
- ((2, 3), (2, 3), (2, 3))])
+ [(0, 1, 0, 1, 0, 1),
+ (2, 3, 2, 3, 2, 3)])
@@ -93,8 +96,8 @@
self.assertEquals(list(m3.find_sync_regions()),
- [((0, 1), (0, 1), (0, 1)),
- ((3, 4), (4, 5), (5, 6))])
+ [(0, 1, 0, 1, 0, 1),
+ (3, 4, 4, 5, 5, 6)])
More information about the Pkg-bazaar-commits
mailing list