Rev 4752: start working on a test that reconcile handles stacking issues appropriately. in http://bazaar.launchpad.net/~jameinel/bzr/2.0.6-reconcile-stacked-441125

John Arbash Meinel john at arbash-meinel.com
Wed Jun 23 21:54:07 BST 2010


At http://bazaar.launchpad.net/~jameinel/bzr/2.0.6-reconcile-stacked-441125

------------------------------------------------------------
revno: 4752
revision-id: john at arbash-meinel.com-20100623205400-bj39ob63mv9ngh2p
parent: pqm at pqm.ubuntu.com-20100528201811-icg1xs1r43knuodl
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: 2.0.6-reconcile-stacked-441125
timestamp: Wed 2010-06-23 15:54:00 -0500
message:
  start working on a test that reconcile handles stacking issues appropriately.
-------------- next part --------------
=== modified file 'bzrlib/tests/per_repository_reference/__init__.py'
--- a/bzrlib/tests/per_repository_reference/__init__.py	2010-04-23 05:30:32 +0000
+++ b/bzrlib/tests/per_repository_reference/__init__.py	2010-06-23 20:54:00 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2008, 2009 Canonical Ltd
+# Copyright (C) 2008, 2009, 2010 Canonical Ltd
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -118,6 +118,7 @@
         'bzrlib.tests.per_repository_reference.test_get_record_stream',
         'bzrlib.tests.per_repository_reference.test_get_rev_id_for_revno',
         'bzrlib.tests.per_repository_reference.test_initialize',
+        'bzrlib.tests.per_repository_reference.test_reconcile',
         'bzrlib.tests.per_repository_reference.test_unlock',
         ]
     # Parameterize per_repository_reference test modules by format.

=== added file 'bzrlib/tests/per_repository_reference/test_reconcile.py'
--- a/bzrlib/tests/per_repository_reference/test_reconcile.py	1970-01-01 00:00:00 +0000
+++ b/bzrlib/tests/per_repository_reference/test_reconcile.py	2010-06-23 20:54:00 +0000
@@ -0,0 +1,48 @@
+# Copyright (C) 2010 Canonical Ltd
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+from bzrlib import errors
+from bzrlib.tests.per_repository_reference import (
+    TestCaseWithExternalReferenceRepository,
+    )
+
+
+class TestReconcile(TestCaseWithExternalReferenceRepository):
+    # Tests that reconcile works on stacked branches
+
+    def test_simple_reconcile(self):
+        tree = self.make_branch_and_tree('sample')
+        self.build_tree(['sample/a'])
+        tree.add(['a'], ['a-id'])
+        rev_id_base = tree.commit('a')
+        self.build_tree(['sample/b'])
+        tree.add(['b'], ['b-id'])
+        rev_id_feature = tree.commit('add b')
+        tree.lock_read()
+        self.addCleanup(tree.unlock)
+        base = self.make_repository('base')
+        base.fetch(tree.branch.repository, revision_id=rev_id_base)
+        repo = self.make_referring('referring', 'base')
+        repo.lock_write()
+        self.addCleanup(repo.unlock)
+        repo.fetch(tree.branch.repository, revision_id=rev_id_feature)
+        # The base revision should not be in the stacked repository.
+        self.assertEqual({},
+            repo.revisions._index.get_parent_map([rev_id_base]))
+        # And neither should the base text
+        self.assertEqual({('b-id', rev_id_feature): ()},
+            repo.texts._index.get_parent_map([('a-id', rev_id_base),
+                                              ('b-id', rev_id_feature)]))



More information about the bazaar-commits mailing list