[Pkg-bazaar-commits] ./bzr/unstable r833: - don't sync up on blank or hash-only lines

Martin Pool mbp at sourcefrog.net
Fri Apr 10 08:21:11 UTC 2009


------------------------------------------------------------
revno: 833
committer: Martin Pool <mbp at sourcefrog.net>
timestamp: Tue 2005-07-05 20:14:37 +1000
message:
  - don't sync up on blank or hash-only lines
modified:
  bzrlib/merge3.py
-------------- next part --------------
=== modified file 'bzrlib/merge3.py'
--- a/bzrlib/merge3.py	2005-07-05 09:55:35 +0000
+++ b/bzrlib/merge3.py	2005-07-05 10:14:37 +0000
@@ -44,7 +44,6 @@
 
 
 
-
 class Merge3(object):
     """3-way merge of texts.
 
@@ -310,8 +309,14 @@
     def find_unconflicted(self):
         """Return a list of ranges in base that are not conflicted."""
         from difflib import SequenceMatcher
-        am = SequenceMatcher(None, self.base, self.a).get_matching_blocks()
-        bm = SequenceMatcher(None, self.base, self.b).get_matching_blocks()
+
+        import re
+
+        # don't sync-up on lines containing only blanks or pounds
+        junk_re = re.compile(r'^[ \t#]*$')
+        
+        am = SequenceMatcher(junk_re.match, self.base, self.a).get_matching_blocks()
+        bm = SequenceMatcher(junk_re.match, self.base, self.b).get_matching_blocks()
 
         unc = []
 



More information about the Pkg-bazaar-commits mailing list