Rev 3512: Don't trust the 3-way logic after a criss-cross. in http://bzr.arbash-meinel.com/branches/bzr/1.6-dev/merge3_per_file

John Arbash Meinel john at arbash-meinel.com
Tue Jun 24 18:16:31 BST 2008


At http://bzr.arbash-meinel.com/branches/bzr/1.6-dev/merge3_per_file

------------------------------------------------------------
revno: 3512
revision-id: john at arbash-meinel.com-20080624171624-mu83fk2x1mgj8k2q
parent: john at arbash-meinel.com-20080624152907-usuu1b5qmom2fao6
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: merge3_per_file
timestamp: Tue 2008-06-24 12:16:24 -0500
message:
  Don't trust the 3-way logic after a criss-cross.
  
  It requires a lot more merging, but it should be 'correct'.
modified:
  bzrlib/merge.py                merge.py-20050513021216-953b65a438527106
-------------- next part --------------
=== modified file 'bzrlib/merge.py'
--- a/bzrlib/merge.py	2008-06-24 15:29:07 +0000
+++ b/bzrlib/merge.py	2008-06-24 17:16:24 +0000
@@ -390,7 +390,8 @@
                   'interesting_ids': self.interesting_ids,
                   'interesting_files': self.interesting_files,
                   'pp': self.pp,
-                  'do_merge': False}
+                  'do_merge': False,
+                  'is_criss_cross':self._is_criss_cross}
         if self.merge_type.requires_base:
             kwargs['base_tree'] = self.base_tree
         if self.merge_type.supports_reprocess:
@@ -469,7 +470,7 @@
                  interesting_ids=None, reprocess=False, show_base=False,
                  pb=DummyProgress(), pp=None, change_reporter=None,
                  interesting_files=None, do_merge=True,
-                 cherrypick=False):
+                 cherrypick=False, is_criss_cross=False):
         """Initialize the merger object and perform the merge.
 
         :param working_tree: The working tree to apply the merge to
@@ -509,6 +510,7 @@
         self.pp = pp
         self.change_reporter = change_reporter
         self.cherrypick = cherrypick
+        self._is_criss_cross = is_criss_cross
         if self.pp is None:
             self.pp = ProgressPhase("Merge phase", 3, self.pb)
         if do_merge:
@@ -811,7 +813,9 @@
         # file kind...
         base_pair = contents_pair(self.base_tree)
         other_pair = contents_pair(self.other_tree)
-        if base_pair == other_pair:
+        # If we have a criss-cross, we can't trust when this == base or other
+        # == base. :(
+        if not self._is_criss_cross and base_pair == other_pair:
             # OTHER introduced no changes
             mutter('BASE == OTHER, not merging: %s', file_id)
             return "unmodified"
@@ -822,7 +826,7 @@
             return "unmodified"
         else:
             trans_id = self.tt.trans_id_file_id(file_id)
-            if this_pair == base_pair:
+            if not self._is_criss_cross and this_pair == base_pair:
                 mutter('THIS == BASE, choosing OTHER: %s', file_id)
                 # only OTHER introduced changes
                 if file_id in self.this_tree:



More information about the bazaar-commits mailing list