~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 10:14:37 UTC
  • Revision ID: mbp@sourcefrog.net-20050705101437-c41d1d0170905106
- don't sync up on blank or hash-only lines

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
 
45
45
 
46
46
 
47
 
 
48
47
class Merge3(object):
49
48
    """3-way merge of texts.
50
49
 
310
309
    def find_unconflicted(self):
311
310
        """Return a list of ranges in base that are not conflicted."""
312
311
        from difflib import SequenceMatcher
313
 
        am = SequenceMatcher(None, self.base, self.a).get_matching_blocks()
314
 
        bm = SequenceMatcher(None, self.base, self.b).get_matching_blocks()
 
312
 
 
313
        import re
 
314
 
 
315
        # don't sync-up on lines containing only blanks or pounds
 
316
        junk_re = re.compile(r'^[ \t#]*$')
 
317
        
 
318
        am = SequenceMatcher(junk_re.match, self.base, self.a).get_matching_blocks()
 
319
        bm = SequenceMatcher(junk_re.match, self.base, self.b).get_matching_blocks()
315
320
 
316
321
        unc = []
317
322