Rev 3881: Rename add_inventory_delta to add_inventory_by_delta. in http://bzr.arbash-meinel.com/branches/bzr/1.11/differ_serializer

John Arbash Meinel john at arbash-meinel.com
Fri Dec 5 16:07:07 GMT 2008


At http://bzr.arbash-meinel.com/branches/bzr/1.11/differ_serializer

------------------------------------------------------------
revno: 3881
revision-id: john at arbash-meinel.com-20081205160704-ti2a80z9tvqehwws
parent: john at arbash-meinel.com-20081205160233-f4c61by1u3kf5sqj
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: differ_serializer
timestamp: Fri 2008-12-05 10:07:04 -0600
message:
  Rename add_inventory_delta to add_inventory_by_delta.
-------------- next part --------------
=== modified file 'NEWS'
--- a/NEWS	2008-12-05 16:02:33 +0000
+++ b/NEWS	2008-12-05 16:07:04 +0000
@@ -47,7 +47,7 @@
       returned from each pack in turn, in forward I/O order.
       (John Arbash Meinel)
 
-    * New method ``bzrlib.repository.Repository.add_inventory_delta``
+    * New method ``bzrlib.repository.Repository.add_inventory_by_delta``
       allows adding an inventory via an inventory delta, which can be
       more efficient for some repository types. (Robert Collins)
 

=== modified file 'bzrlib/remote.py'
--- a/bzrlib/remote.py	2008-12-05 16:02:33 +0000
+++ b/bzrlib/remote.py	2008-12-05 16:07:04 +0000
@@ -766,10 +766,10 @@
         self._ensure_real()
         return self._real_repository.add_inventory(revid, inv, parents)
 
-    def add_inventory_delta(self, basis_revision_id, delta, new_revision_id,
-        parents):
+    def add_inventory_by_delta(self, basis_revision_id, delta, new_revision_id,
+                               parents):
         self._ensure_real()
-        return self._real_repository.add_inventory_delta(basis_revision_id,
+        return self._real_repository.add_inventory_by_delta(basis_revision_id,
             delta, new_revision_id, parents)
 
     def add_revision(self, rev_id, rev, inv=None, config=None):

=== modified file 'bzrlib/repository.py'
--- a/bzrlib/repository.py	2008-12-05 16:02:33 +0000
+++ b/bzrlib/repository.py	2008-12-05 16:07:04 +0000
@@ -648,12 +648,12 @@
         return self._inventory_add_lines(revision_id, parents,
             inv_lines, check_content=False)
 
-    def add_inventory_delta(self, basis_revision_id, delta, new_revision_id,
-        parents):
+    def add_inventory_by_delta(self, basis_revision_id, delta, new_revision_id,
+                               parents):
         """Add a new inventory expressed as a delta against another revision.
-        
+
         :param basis_revision_id: The inventory id the delta was created
-            against.
+            against. (This does not have to be a direct parent.)
         :param delta: The inventory delta (see Inventory.apply_delta for
             details).
         :param new_revision_id: The revision id that the inventory is being

=== modified file 'bzrlib/tests/per_repository/__init__.py'
--- a/bzrlib/tests/per_repository/__init__.py	2008-12-05 16:02:33 +0000
+++ b/bzrlib/tests/per_repository/__init__.py	2008-12-05 16:07:04 +0000
@@ -858,8 +858,8 @@
     result.addTests(basic_tests)
     prefix = 'bzrlib.tests.per_repository.'
     test_repository_modules = [
-        'test_add_inventory_delta',
         'test_add_fallback_repository',
+        'test_add_inventory_by_delta',
         'test_break_lock',
         'test_check',
         # test_check_reconcile is intentionally omitted, see below.

=== renamed file 'bzrlib/tests/per_repository/test_add_inventory_delta.py' => 'bzrlib/tests/per_repository/test_add_inventory_by_delta.py'
--- a/bzrlib/tests/per_repository/test_add_inventory_delta.py	2008-10-13 00:28:17 +0000
+++ b/bzrlib/tests/per_repository/test_add_inventory_by_delta.py	2008-12-05 16:07:04 +0000
@@ -14,13 +14,13 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
-"""Tests for Repository.add_inventory_delta."""
+"""Tests for Repository.add_inventory_by_delta."""
 
 from bzrlib import errors, revision
 from bzrlib.tests.per_repository import TestCaseWithRepository
 
 
-class TestAddInventoryDelta(TestCaseWithRepository):
+class TestAddInventoryByDelta(TestCaseWithRepository):
 
     def _get_repo_in_write_group(self, path='repository'):
         repo = self.make_repository(path)
@@ -28,13 +28,13 @@
         self.addCleanup(repo.unlock)
         repo.start_write_group()
         return repo
-    
+
     def test_basis_missing_errors(self):
         repo = self._get_repo_in_write_group()
         try:
             self.assertRaises(errors.NoSuchRevision,
-                repo.add_inventory_delta, "missing-revision", [], "new-revision",
-                ["missing-revision"])
+                repo.add_inventory_by_delta, "missing-revision", [],
+                "new-revision", ["missing-revision"])
         finally:
             repo.abort_write_group()
 
@@ -42,7 +42,7 @@
         repo = self.make_repository('repository')
         repo.lock_write()
         self.addCleanup(repo.unlock)
-        self.assertRaises(AssertionError, repo.add_inventory_delta,
+        self.assertRaises(AssertionError, repo.add_inventory_by_delta,
             "missing-revision", [], "new-revision", ["missing-revision"])
 
     def make_inv_delta(self, old, new):
@@ -80,8 +80,8 @@
         repo_direct.commit_write_group()
         repo_delta = self._get_repo_in_write_group('delta')
         try:
-            delta_validator = repo_delta.add_inventory_delta(revision.NULL_REVISION,
-                delta, revid, [])
+            delta_validator = repo_delta.add_inventory_by_delta(
+                revision.NULL_REVISION, delta, revid, [])
         except:
             repo_delta.abort_write_group()
             raise



More information about the bazaar-commits mailing list