Rev 3538: Add a test which shows that the ordering switches when you pick the other parent. in http://bzr.arbash-meinel.com/branches/bzr/1.7-dev/merge_lca_multi

John Arbash Meinel john at arbash-meinel.com
Wed Jul 23 00:05:37 BST 2008


At http://bzr.arbash-meinel.com/branches/bzr/1.7-dev/merge_lca_multi

------------------------------------------------------------
revno: 3538
revision-id: john at arbash-meinel.com-20080722230431-j53l4m4t328nq0nb
parent: john at arbash-meinel.com-20080722222542-r4so03343ba2me68
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: merge_lca_multi
timestamp: Tue 2008-07-22 18:04:31 -0500
message:
  Add a test which shows that the ordering switches when you pick the other parent.
-------------- next part --------------
=== modified file 'bzrlib/tests/test_merge.py'
--- a/bzrlib/tests/test_merge.py	2008-07-22 22:25:42 +0000
+++ b/bzrlib/tests/test_merge.py	2008-07-22 23:04:31 +0000
@@ -1163,11 +1163,17 @@
         self.assertIs(None, merger._lca_trees)
 
     def test_find_base_criss_cross(self):
-        merger = self.make_Merger(self.setup_criss_cross_graph(), 'E-id')
+        builder = self.setup_criss_cross_graph()
+        merger = self.make_Merger(builder, 'E-id')
         self.assertEqual('A-id', merger.base_rev_id)
         self.assertTrue(merger._is_criss_cross)
         self.assertEqual(['B-id', 'C-id'], [t.get_revision_id()
                                             for t in merger._lca_trees])
+        # If we swap the order, we should get a different base
+        builder.build_snapshot('F-id', ['E-id'], [])
+        merger = self.make_Merger(builder, 'D-id')
+        self.assertEqual(['C-id', 'B-id'], [t.get_revision_id()
+                                            for t in merger._lca_trees])
 
     def test_no_criss_cross_passed_to_merge_type(self):
         class LCATreesMerger(LoggingMerger):
@@ -1341,3 +1347,4 @@
     #       x-x OTHER introduces the file
     #       x-x LCAs differ, one in ancestry of other for a given file
     #       x-x file missing in LCA
+    #       x-x Reverted back to BASE text



More information about the bazaar-commits mailing list