~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/merge3.py

  • Committer: Martin Pool
  • Date: 2005-07-05 07:32:22 UTC
  • Revision ID: mbp@sourcefrog.net-20050705073222-ad90cc36af41563a
- Merge3.find_sync_regions yields just a 6-tuple, not a tuple of tuples

Show diffs side-by-side

added added

removed removed

Lines of Context:
82
82
        The regions in between can be in any of three cases:
83
83
        conflicted, or changed on only one side.
84
84
        """
 
85
        
85
86
 
86
87
        
87
88
    def find_sync_regions(self):
88
89
        """Return a list of sync regions, where both descendents match the base.
89
90
 
90
 
        Generates a list of ((base1, base2), (a1, a2), (b1, b2)). 
 
91
        Generates a list of (base1, base2, a1, a2, b1, b2). 
91
92
        """
92
93
        from difflib import SequenceMatcher
93
94
        aiter = iter(SequenceMatcher(None, self.base, self.a).get_matching_blocks())
122
123
                
123
124
                assert self.base[intbase:intend] == self.b[bsub:bend]
124
125
 
125
 
                yield ((intbase, intend),
126
 
                       (asub, aend),
127
 
                       (bsub, bend))
 
126
                yield (intbase, intend,
 
127
                       asub, aend,
 
128
                       bsub, bend)
128
129
 
129
130
            # advance whichever one ends first in the base text
130
131
            if (abase + alen) < (bbase + blen):