Rev 4793: Robert says that self.new_inventory shouldn't be set. in http://bazaar.launchpad.net/~jameinel/bzr/2.1.0b4-builder-add-inv-by-delta

John Arbash Meinel john at arbash-meinel.com
Thu Nov 19 15:06:53 GMT 2009


At http://bazaar.launchpad.net/~jameinel/bzr/2.1.0b4-builder-add-inv-by-delta

------------------------------------------------------------
revno: 4793
revision-id: john at arbash-meinel.com-20091119150647-2m1l640b6ka9rniq
parent: john at arbash-meinel.com-20091118222108-4hpbkiswmfn6blv7
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: 2.1.0b4-builder-add-inv-by-delta
timestamp: Thu 2009-11-19 09:06:47 -0600
message:
  Robert says that self.new_inventory shouldn't be set.
  
  I would think it wouldn't matter because the 'if self.new_inventory is None'
  was already checked at the start of CommitBuilder.finish_inventory().
  Anyway, we don't really use it, so don't worry about it.
-------------- next part --------------
=== modified file 'bzrlib/repository.py'
--- a/bzrlib/repository.py	2009-11-13 19:20:51 +0000
+++ b/bzrlib/repository.py	2009-11-19 15:06:47 +0000
@@ -206,9 +206,10 @@
             # an inventory delta was accumulated without creating a new
             # inventory.
             basis_id = self.basis_delta_revision
-            # TODO: Broken
-            (self.inv_sha1,
-             self.new_inventory) = self.repository.add_inventory_by_delta(
+            # We ignore the 'inventory' returned by add_inventory_by_delta
+            # because self.new_inventory is used to hint to the rest of the
+            # system what code path was taken
+            self.inv_sha1, _ = self.repository.add_inventory_by_delta(
                 basis_id, self._basis_delta, self._new_revision_id,
                 self.parents)
         else:

=== modified file 'bzrlib/tests/per_repository/test_commit_builder.py'
--- a/bzrlib/tests/per_repository/test_commit_builder.py	2009-11-18 22:17:36 +0000
+++ b/bzrlib/tests/per_repository/test_commit_builder.py	2009-11-19 15:06:47 +0000
@@ -900,7 +900,7 @@
             inv_sha1 = tree.branch.repository.inventories.get_sha1s(
                             [inv_key])[inv_key]
             self.assertEqual(inv_sha1, builder.inv_sha1)
-            self.assertIsNot(None, builder.new_inventory)
+            self.assertIs(None, builder.new_inventory)
             new_inventory = builder.revision_tree().inventory
             new_entry = new_inventory[file_id]
             if delta_against_basis:



More information about the bazaar-commits mailing list