~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/merge3.py

'bzr selftest' now shows a progress bar with the number of tests, and 
progress made. 'make check' shows tests in -v mode, to be more useful
for the PQM status window. (Robert Collins).

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
# s: "i hate that."
20
20
 
21
21
 
 
22
from difflib import SequenceMatcher
 
23
 
22
24
from bzrlib.errors import CantReprocessAndShowBase
23
 
import bzrlib.patiencediff
24
25
from bzrlib.textfile import check_text_lines
25
26
 
26
 
 
27
27
def intersect(ra, rb):
28
28
    """Given two ranges return the range where they intersect or None.
29
29
 
294
294
            type, iz, zmatch, ia, amatch, ib, bmatch = region
295
295
            a_region = self.a[ia:amatch]
296
296
            b_region = self.b[ib:bmatch]
297
 
            matches = bzrlib.patiencediff.PatienceSequenceMatcher(
298
 
                    None, a_region, b_region).get_matching_blocks()
 
297
            matches = SequenceMatcher(None, a_region, 
 
298
                                      b_region).get_matching_blocks()
299
299
            next_a = ia
300
300
            next_b = ib
301
301
            for region_ia, region_ib, region_len in matches[:-1]:
327
327
        """
328
328
 
329
329
        ia = ib = 0
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()
 
330
        amatches = SequenceMatcher(None, self.base, self.a).get_matching_blocks()
 
331
        bmatches = SequenceMatcher(None, self.base, self.b).get_matching_blocks()
334
332
        len_a = len(amatches)
335
333
        len_b = len(bmatches)
336
334
 
386
384
 
387
385
    def find_unconflicted(self):
388
386
        """Return a list of ranges in base that are not conflicted."""
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()
 
387
 
 
388
        import re
 
389
 
 
390
        # don't sync-up on lines containing only blanks or pounds
 
391
        junk_re = re.compile(r'^[ \t#]*$')
 
392
        
 
393
        am = SequenceMatcher(junk_re.match, self.base, self.a).get_matching_blocks()
 
394
        bm = SequenceMatcher(junk_re.match, self.base, self.b).get_matching_blocks()
393
395
 
394
396
        unc = []
395
397