Rev 5857: (jelmer) Remove use of inventory in a commit builder tests, in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Fri May 13 10:43:23 UTC 2011


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 5857 [merge]
revision-id: pqm at pqm.ubuntu.com-20110513104321-8j4cwyl49p3f2bwc
parent: pqm at pqm.ubuntu.com-20110513082913-2igf61vxl0gqoilw
parent: jelmer at samba.org-20110513084344-tlq3zvmsdbmwoem8
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Fri 2011-05-13 10:43:21 +0000
message:
  (jelmer) Remove use of inventory in a commit builder tests,
   remove broken and duplicate test_break_lock in per_foreign_vcs. (Jelmer
   Vernooij)
modified:
  bzrlib/tests/per_foreign_vcs/test_branch.py test_branch.py-20090804140930-7hsx6rgekjy0yzjx-1
  bzrlib/tests/per_repository/test_commit_builder.py test_commit_builder.py-20060606110838-76e3ra5slucqus81-1
=== modified file 'bzrlib/tests/per_foreign_vcs/test_branch.py'
--- a/bzrlib/tests/per_foreign_vcs/test_branch.py	2011-03-06 14:18:11 +0000
+++ b/bzrlib/tests/per_foreign_vcs/test_branch.py	2011-05-13 08:37:15 +0000
@@ -61,11 +61,6 @@
         branch = self.make_branch()
         branch.set_parent("foobar")
 
-    def test_break_lock(self):
-        """Test that break_lock() works, even if it is a no-op."""
-        branch = self.make_branch()
-        branch.break_lock()
-
     def test_set_push_location(self):
         """Test that setting the push location works."""
         branch = self.make_branch()
@@ -148,5 +143,3 @@
 
     def test_network_name(self):
         self.assertIsInstance(self.branch_format.network_name(), str)
-
-

=== modified file 'bzrlib/tests/per_repository/test_commit_builder.py'
--- a/bzrlib/tests/per_repository/test_commit_builder.py	2011-05-04 13:00:00 +0000
+++ b/bzrlib/tests/per_repository/test_commit_builder.py	2011-05-13 08:36:56 +0000
@@ -241,11 +241,11 @@
         try:
             self.build_tree(['foo'])
             tree.add('foo', 'foo-id')
+            builder = tree.branch.get_commit_builder([])
+            if not builder.supports_record_entry_contents:
+                raise tests.TestNotApplicable("CommitBuilder doesn't support "
+                    "record_entry_contents")
             entry = tree.inventory['foo-id']
-            builder = tree.branch.get_commit_builder([])
-            if not builder.supports_record_entry_contents:
-                raise tests.TestNotApplicable("CommitBuilder doesn't support "
-                    "record_entry_contents")
             self.assertRaises(errors.RootMissing,
                 builder.record_entry_contents, entry, [], 'foo', tree,
                     tree.path_content_summary('foo'))
@@ -937,10 +937,10 @@
             parent_tree = tree.basis_tree()
             parent_tree.lock_read()
             self.addCleanup(parent_tree.unlock)
-            parent_invs = [parent_tree.inventory]
+            parent_trees = [parent_tree]
             for parent_id in parent_ids[1:]:
-                parent_invs.append(tree.branch.repository.revision_tree(
-                    parent_id).inventory)
+                parent_trees.append(tree.branch.repository.revision_tree(
+                    parent_id))
             changes = list(tree.iter_changes(parent_tree))
             result = list(builder.record_iter_changes(tree, parent_ids[0],
                 changes))




More information about the bazaar-commits mailing list