Rev 2423: Add another test that makes sure we can add as long as the file_id isn't current. in http://bazaar.launchpad.net/%7Ebzr/bzr/dirstate

John Arbash Meinel john at arbash-meinel.com
Mon Feb 26 22:12:07 GMT 2007


At http://bazaar.launchpad.net/%7Ebzr/bzr/dirstate

------------------------------------------------------------
revno: 2423
revision-id: john at arbash-meinel.com-20070226221107-q3sz1brqz1yxugos
parent: john at arbash-meinel.com-20070226220814-i6a95mlsdsv3yrf8
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: dirstate
timestamp: Mon 2007-02-26 16:11:07 -0600
message:
  Add another test that makes sure we can add as long as the file_id isn't current.
modified:
  bzrlib/tests/workingtree_implementations/test_add.py test_add.py-20070226165239-4vo178spkrnhavc7-1
-------------- next part --------------
=== modified file 'bzrlib/tests/workingtree_implementations/test_add.py'
--- a/bzrlib/tests/workingtree_implementations/test_add.py	2007-02-26 22:08:14 +0000
+++ b/bzrlib/tests/workingtree_implementations/test_add.py	2007-02-26 22:11:07 +0000
@@ -62,6 +62,20 @@
         # And the entry should not have been added.
         self.assertTreeLayout([('', root_id), ('a', 'an-id')], tree)
 
+    def test_add_old_id(self):
+        """We can add an old id, as long as it doesn't exist now."""
+        tree = self.make_branch_and_tree('.')
+        self.build_tree(['a', 'b'])
+        tree.add(['a'], ['an-id'])
+        tree.commit('first', rev_id='rev-1')
+        root_id = tree.get_root_id()
+        # And the entry should not have been added.
+        tree.unversion(['an-id'])
+        tree.add(['b'], ['an-id'])
+        self.assertTreeLayout([('', root_id), ('b', 'an-id')], tree)
+        self.assertTreeLayout([('', root_id), ('a', 'an-id')],
+                              tree.basis_tree())
+
     def test_add_one_list(self):
         tree = self.make_branch_and_tree('.')
         self.build_tree(['one'])



More information about the bazaar-commits mailing list