Rev 3781: Merge bb-core. in http://people.ubuntu.com/~robertc/baz2.0/repository

Robert Collins robertc at robertcollins.net
Fri Nov 14 03:39:48 GMT 2008


At http://people.ubuntu.com/~robertc/baz2.0/repository

------------------------------------------------------------
revno: 3781
revision-id: robertc at robertcollins.net-20081114033944-4ykgkaa0dlauq40k
parent: robertc at robertcollins.net-20081114033634-9ns1w15wx9f17tpk
parent: vila at scythe-20081114025149-pjkkn2s5ik6t1eyw
committer: Robert Collins <robertc at robertcollins.net>
branch nick: repository
timestamp: Fri 2008-11-14 14:39:44 +1100
message:
  Merge bb-core.
modified:
  bzrlib/tests/intertree_implementations/test_compare.py test_compare.py-20060724101752-09ysswo1a92uqyoz-2
    ------------------------------------------------------------
    revno: 3768.1.9
    revision-id: vila at scythe-20081114025149-pjkkn2s5ik6t1eyw
    parent: vila at scythe-20081114024744-aafdh5drog7476lz
    parent: robertc at robertcollins.net-20081114021953-ckqpcsakzrk1ns1l
    committer: Vincent Ladeuil <vila at scythe>
    branch nick: work
    timestamp: Fri 2008-11-14 12:51:49 +1000
    message:
      merge bbc at 3778
    modified:
      bzrlib/chk_map.py              chk_map.py-20081001014447-ue6kkuhofvdecvxa-1
      bzrlib/inventory.py            inventory.py-20050309040759-6648b84ca2005b37
      bzrlib/tests/test_inv.py       testinv.py-20050722220913-1dc326138d1a5892
      bzrlib/tests/test_repository.py test_repository.py-20060131075918-65c555b881612f4d
    ------------------------------------------------------------
    revno: 3768.1.8
    revision-id: vila at scythe-20081114024744-aafdh5drog7476lz
    parent: vila at scythe-20081114020010-eg7poezqh3r0j142
    committer: Vincent Ladeuil <vila at scythe>
    branch nick: work
    timestamp: Fri 2008-11-14 12:47:44 +1000
    message:
      Get rid of failures related to not applicable tests.
      
      * tests/intertree_implementations/test_compare.py:
      (TestIterChanges.not_applicable_if_missing_in): New helper to flag
      not applicable tests.
      (TestIterChanges.test_missing_and_renamed,
      TestIterChanges.test_only_in_source_and_missing,
      TestIterChanges.test_only_in_target_and_missing): Not applicable
      if the tree needs to support missing files.
    modified:
      bzrlib/tests/intertree_implementations/test_compare.py test_compare.py-20060724101752-09ysswo1a92uqyoz-2
=== modified file 'bzrlib/tests/intertree_implementations/test_compare.py'
--- a/bzrlib/tests/intertree_implementations/test_compare.py	2008-09-08 20:38:46 +0000
+++ b/bzrlib/tests/intertree_implementations/test_compare.py	2008-11-14 02:47:44 +0000
@@ -501,6 +501,14 @@
                 (None, basename), (None, kind),
                 (None, False))
 
+    def not_applicable_if_missing_in(self, relpath, tree):
+        if not tree.path2id(relpath):
+            # The locked test trees conversion could not preserve the missing
+            # file status. This is normal (e.g. InterDirstateTree falls back
+            # to InterTree if the basis is not a DirstateRevisionTree, and
+            # revision trees cannot have missing files. 
+            raise TestNotApplicable()
+
     def test_empty_to_abc_content(self):
         tree1 = self.make_branch_and_tree('1')
         tree2 = self.make_to_branch_and_tree('2')
@@ -690,6 +698,7 @@
         tree2.add(['directory'], ['file-id'])
         os.rmdir('tree2/directory')
         tree1, tree2 = self.mutable_trees_to_locked_test_trees(tree1, tree2)
+        self.not_applicable_if_missing_in('directory', tree2)
 
         root_id = tree1.path2id('')
         expected = sorted([
@@ -705,13 +714,8 @@
         tree1.add(['file'], ['file-id'])
         os.unlink('tree1/file')
         tree1, tree2 = self.mutable_trees_to_locked_test_trees(tree1, tree2)
+        self.not_applicable_if_missing_in('file', tree1)
         root_id = tree1.path2id('')
-        if not tree1.path2id('file'):
-            # The locked test trees conversion could not preserve the missing
-            # file status. This is normal (e.g. InterDirstateTree falls back
-            # to InterTree if the basis is not a DirstateRevisionTree, and
-            # revision trees cannot have missing files. 
-            raise TestNotApplicable()
         expected = [('file-id', ('file', None), False, (True, False),
             (root_id, None), ('file', None), (None, None), (False, None))]
         self.assertEqual(expected, self.do_iter_changes(tree1, tree2))
@@ -724,6 +728,7 @@
         tree2.add(['file'], ['file-id'])
         os.unlink('tree2/file')
         tree1, tree2 = self.mutable_trees_to_locked_test_trees(tree1, tree2)
+        self.not_applicable_if_missing_in('file', tree2)
         root_id = tree1.path2id('')
         expected = [('file-id', (None, 'file'), False, (False, True),
             (None, root_id), (None, 'file'), (None, None), (None, False))]




More information about the bazaar-commits mailing list