~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/merge3.py

  • Committer: Aaron Bentley
  • Date: 2007-03-07 23:15:10 UTC
  • mto: (1551.19.24 Aaron's mergeable stuff)
  • mto: This revision was merged to the branch mainline in revision 2325.
  • Revision ID: abentley@panoramicfeedback.com-20070307231510-jae63zsli83db3eb
Make ChangeReporter private

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2004, 2005 by Canonical Ltd
2
 
 
 
1
# Copyright (C) 2004, 2005 Canonical Ltd
 
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
5
5
# the Free Software Foundation; either version 2 of the License, or
6
6
# (at your option) any later version.
7
 
 
 
7
#
8
8
# This program is distributed in the hope that it will be useful,
9
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
11
# GNU General Public License for more details.
12
 
 
 
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20
20
 
21
21
 
22
22
from bzrlib.errors import CantReprocessAndShowBase
23
 
from bzrlib.patiencediff import SequenceMatcher
 
23
import bzrlib.patiencediff
24
24
from bzrlib.textfile import check_text_lines
25
25
 
 
26
 
26
27
def intersect(ra, rb):
27
28
    """Given two ranges return the range where they intersect or None.
28
29
 
293
294
            type, iz, zmatch, ia, amatch, ib, bmatch = region
294
295
            a_region = self.a[ia:amatch]
295
296
            b_region = self.b[ib:bmatch]
296
 
            matches = SequenceMatcher(None, a_region, 
297
 
                                      b_region).get_matching_blocks()
 
297
            matches = bzrlib.patiencediff.PatienceSequenceMatcher(
 
298
                    None, a_region, b_region).get_matching_blocks()
298
299
            next_a = ia
299
300
            next_b = ib
300
301
            for region_ia, region_ib, region_len in matches[:-1]:
326
327
        """
327
328
 
328
329
        ia = ib = 0
329
 
        amatches = SequenceMatcher(None, self.base, self.a).get_matching_blocks()
330
 
        bmatches = SequenceMatcher(None, self.base, self.b).get_matching_blocks()
 
330
        amatches = bzrlib.patiencediff.PatienceSequenceMatcher(
 
331
                None, self.base, self.a).get_matching_blocks()
 
332
        bmatches = bzrlib.patiencediff.PatienceSequenceMatcher(
 
333
                None, self.base, self.b).get_matching_blocks()
331
334
        len_a = len(amatches)
332
335
        len_b = len(bmatches)
333
336
 
383
386
 
384
387
    def find_unconflicted(self):
385
388
        """Return a list of ranges in base that are not conflicted."""
386
 
        am = SequenceMatcher(None, self.base, self.a).get_matching_blocks()
387
 
        bm = SequenceMatcher(None, self.base, self.b).get_matching_blocks()
 
389
        am = bzrlib.patiencediff.PatienceSequenceMatcher(
 
390
                None, self.base, self.a).get_matching_blocks()
 
391
        bm = bzrlib.patiencediff.PatienceSequenceMatcher(
 
392
                None, self.base, self.b).get_matching_blocks()
388
393
 
389
394
        unc = []
390
395