Rev 4993: (Jelmer) Make Repository.deserialise_inventory() private. in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Mon Feb 1 08:54:10 GMT 2010


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

------------------------------------------------------------
revno: 4993 [merge]
revision-id: pqm at pqm.ubuntu.com-20100201085408-1c990l08fmh5x3ix
parent: pqm at pqm.ubuntu.com-20100131232833-877lg7ld5zr21tc5
parent: jelmer at samba.org-20100131121040-64t9ykvo2oz4pknx
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Mon 2010-02-01 08:54:08 +0000
message:
  (Jelmer) Make Repository.deserialise_inventory() private.
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/remote.py               remote.py-20060720103555-yeeg2x51vn0rbtdp-1
  bzrlib/repofmt/groupcompress_repo.py repofmt.py-20080715094215-wp1qfvoo7093c8qr-1
  bzrlib/repository.py           rev_storage.py-20051111201905-119e9401e46257e3
  bzrlib/tests/test_repository.py test_repository.py-20060131075918-65c555b881612f4d
=== modified file 'NEWS'
--- a/NEWS	2010-01-31 12:28:55 +0000
+++ b/NEWS	2010-02-01 08:54:08 +0000
@@ -34,6 +34,10 @@
 API Changes
 ***********
 
+* ``Repository.deserialise_inventory`` has been renamed to 
+  ``Repository._deserialise_inventory`` to indicate it is private.
+  (Jelmer Vernooij)
+
 Internals
 *********
 

=== modified file 'bzrlib/remote.py'
--- a/bzrlib/remote.py	2010-01-20 16:47:49 +0000
+++ b/bzrlib/remote.py	2010-01-31 12:10:40 +0000
@@ -1501,9 +1501,9 @@
         self._ensure_real()
         return self._real_repository.get_inventory_xml(revision_id)
 
-    def deserialise_inventory(self, revision_id, xml):
+    def _deserialise_inventory(self, revision_id, xml):
         self._ensure_real()
-        return self._real_repository.deserialise_inventory(revision_id, xml)
+        return self._real_repository._deserialise_inventory(revision_id, xml)
 
     def reconcile(self, other=None, thorough=False):
         self._ensure_real()

=== modified file 'bzrlib/repofmt/groupcompress_repo.py'
--- a/bzrlib/repofmt/groupcompress_repo.py	2010-01-21 21:13:09 +0000
+++ b/bzrlib/repofmt/groupcompress_repo.py	2010-01-31 12:10:40 +0000
@@ -882,7 +882,7 @@
             if basis_tree is not None:
                 basis_tree.unlock()
 
-    def deserialise_inventory(self, revision_id, bytes):
+    def _deserialise_inventory(self, revision_id, bytes):
         return inventory.CHKInventory.deserialise(self.chk_bytes, bytes,
             (revision_id,))
 

=== modified file 'bzrlib/repository.py'
--- a/bzrlib/repository.py	2010-01-29 17:49:26 +0000
+++ b/bzrlib/repository.py	2010-01-31 12:10:40 +0000
@@ -1240,7 +1240,7 @@
         """Check a single text from this repository."""
         if kind == 'inventories':
             rev_id = record.key[0]
-            inv = self.deserialise_inventory(rev_id,
+            inv = self._deserialise_inventory(rev_id,
                 record.get_bytes_as('fulltext'))
             if last_object is not None:
                 delta = inv._make_delta(last_object)
@@ -2388,7 +2388,7 @@
         """single-document based inventory iteration."""
         inv_xmls = self._iter_inventory_xmls(revision_ids, ordering)
         for text, revision_id in inv_xmls:
-            yield self.deserialise_inventory(revision_id, text)
+            yield self._deserialise_inventory(revision_id, text)
 
     def _iter_inventory_xmls(self, revision_ids, ordering):
         if ordering is None:
@@ -2426,7 +2426,7 @@
                         next_key = None
                         break
 
-    def deserialise_inventory(self, revision_id, xml):
+    def _deserialise_inventory(self, revision_id, xml):
         """Transform the xml into an inventory object.
 
         :param revision_id: The expected revision id of the inventory.

=== modified file 'bzrlib/tests/test_repository.py'
--- a/bzrlib/tests/test_repository.py	2010-01-21 21:13:09 +0000
+++ b/bzrlib/tests/test_repository.py	2010-01-31 12:10:40 +0000
@@ -465,7 +465,7 @@
         repo = self.make_repository('.',
                 format=bzrdir.format_registry.get('knit')())
         inv_xml = '<inventory format="5">\n</inventory>\n'
-        inv = repo.deserialise_inventory('test-rev-id', inv_xml)
+        inv = repo._deserialise_inventory('test-rev-id', inv_xml)
         self.assertEqual('test-rev-id', inv.root.revision)
 
     def test_deserialise_uses_global_revision_id(self):
@@ -477,9 +477,9 @@
         # Arguably, the deserialise_inventory should detect a mismatch, and
         # raise an error, rather than silently using one revision_id over the
         # other.
-        self.assertRaises(AssertionError, repo.deserialise_inventory,
+        self.assertRaises(AssertionError, repo._deserialise_inventory,
             'test-rev-id', inv_xml)
-        inv = repo.deserialise_inventory('other-rev-id', inv_xml)
+        inv = repo._deserialise_inventory('other-rev-id', inv_xml)
         self.assertEqual('other-rev-id', inv.root.revision)
 
     def test_supports_external_lookups(self):




More information about the bazaar-commits mailing list