Rev 4994: (Jelmer) Make Repository.get_inventory_xml private. in file:///home/pqm/archives/thelove/bzr/%2Btrunk/
Canonical.com Patch Queue Manager
pqm at pqm.ubuntu.com
Mon Feb 1 12:21:36 GMT 2010
At file:///home/pqm/archives/thelove/bzr/%2Btrunk/
------------------------------------------------------------
revno: 4994 [merge]
revision-id: pqm at pqm.ubuntu.com-20100201122133-g8vkmptowez6qaqi
parent: pqm at pqm.ubuntu.com-20100201085408-1c990l08fmh5x3ix
parent: jelmer at samba.org-20100201113902-sh9ea8v6hi8affxr
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Mon 2010-02-01 12:21:33 +0000
message:
(Jelmer) Make Repository.get_inventory_xml private.
modified:
NEWS NEWS-20050323055033-4e00b5db738777ff
bzrlib/foreign.py foreign.py-20081112170002-olsxmandkk8qyfuq-1
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_bundle.py test.py-20050630184834-092aa401ab9f039c
bzrlib/tests/test_workingtree_4.py test_workingtree_4.p-20070223025758-531n3tznl3zacv2o-1
bzrlib/workingtree.py workingtree.py-20050511021032-29b6ec0a681e02e3
=== modified file 'NEWS'
--- a/NEWS 2010-02-01 08:54:08 +0000
+++ b/NEWS 2010-02-01 11:39:02 +0000
@@ -34,6 +34,10 @@
API Changes
***********
+* ``Repository.get_inventory_xml`` has been renamed to
+ ``Repository._get_inventory_xml`` to indicate it is private.
+ (Jelmer Vernooij)
+
* ``Repository.deserialise_inventory`` has been renamed to
``Repository._deserialise_inventory`` to indicate it is private.
(Jelmer Vernooij)
=== modified file 'bzrlib/foreign.py'
--- a/bzrlib/foreign.py 2010-01-29 17:49:26 +0000
+++ b/bzrlib/foreign.py 2010-01-31 12:05:38 +0000
@@ -225,8 +225,8 @@
"""Get the default mapping for this repository."""
raise NotImplementedError(self.get_default_mapping)
- def get_inventory_xml(self, revision_id):
- """See Repository.get_inventory_xml()."""
+ def _get_inventory_xml(self, revision_id):
+ """See Repository._get_inventory_xml()."""
return self.serialise_inventory(self.get_inventory(revision_id))
def get_revision_xml(self, revision_id):
=== modified file 'bzrlib/remote.py'
--- a/bzrlib/remote.py 2010-01-31 12:10:40 +0000
+++ b/bzrlib/remote.py 2010-02-01 11:39:02 +0000
@@ -1497,9 +1497,9 @@
return self._real_repository.get_signature_text(revision_id)
@needs_read_lock
- def get_inventory_xml(self, revision_id):
+ def _get_inventory_xml(self, revision_id):
self._ensure_real()
- return self._real_repository.get_inventory_xml(revision_id)
+ return self._real_repository._get_inventory_xml(revision_id)
def _deserialise_inventory(self, revision_id, xml):
self._ensure_real()
=== modified file 'bzrlib/repofmt/groupcompress_repo.py'
--- a/bzrlib/repofmt/groupcompress_repo.py 2010-01-31 12:10:40 +0000
+++ b/bzrlib/repofmt/groupcompress_repo.py 2010-02-01 11:39:02 +0000
@@ -904,7 +904,7 @@
def _iter_inventory_xmls(self, revision_ids, ordering):
# Without a native 'xml' inventory, this method doesn't make sense.
# However older working trees, and older bundles want it - so we supply
- # it allowing get_inventory_xml to work. Bundles currently use the
+ # it allowing _get_inventory_xml to work. Bundles currently use the
# serializer directly; this also isn't ideal, but there isn't an xml
# iteration interface offered at all for repositories. We could make
# _iter_inventory_xmls be part of the contract, even if kept private.
=== modified file 'bzrlib/repository.py'
--- a/bzrlib/repository.py 2010-01-31 12:10:40 +0000
+++ b/bzrlib/repository.py 2010-02-01 11:39:02 +0000
@@ -2450,8 +2450,8 @@
return self._serializer.format_num
@needs_read_lock
- def get_inventory_xml(self, revision_id):
- """Get inventory XML as a file object."""
+ def _get_inventory_xml(self, revision_id):
+ """Get serialized inventory as a string."""
texts = self._iter_inventory_xmls([revision_id], 'unordered')
try:
text, revision_id = texts.next()
=== modified file 'bzrlib/tests/test_bundle.py'
--- a/bzrlib/tests/test_bundle.py 2010-01-29 17:49:26 +0000
+++ b/bzrlib/tests/test_bundle.py 2010-01-31 12:05:38 +0000
@@ -1039,7 +1039,7 @@
bundle = read_bundle(self.create_bundle_text('null:', 'rev2')[0])
repo = self.make_repository('repo', format='dirstate-with-subtree')
bundle.install_revisions(repo)
- inv_text = repo.get_inventory_xml('rev2')
+ inv_text = repo._get_inventory_xml('rev2')
self.assertNotContainsRe(inv_text, 'format="5"')
self.assertContainsRe(inv_text, 'format="7"')
@@ -1066,7 +1066,7 @@
def test_inv_hash_across_serializers(self):
repo = self.make_repo_with_installed_revisions()
recorded_inv_sha1 = repo.get_revision('rev2').inventory_sha1
- xml = repo.get_inventory_xml('rev2')
+ xml = repo._get_inventory_xml('rev2')
self.assertEqual(osutils.sha_string(xml), recorded_inv_sha1)
def test_across_models_incompatible(self):
=== modified file 'bzrlib/tests/test_workingtree_4.py'
--- a/bzrlib/tests/test_workingtree_4.py 2010-01-25 17:48:22 +0000
+++ b/bzrlib/tests/test_workingtree_4.py 2010-01-31 12:05:38 +0000
@@ -176,7 +176,7 @@
repo = tree.branch.repository
repo.get_revision = self.fail
repo.get_inventory = self.fail
- repo.get_inventory_xml = self.fail
+ repo._get_inventory_xml = self.fail
# try to set the parent trees.
tree.set_parent_trees([(rev1, rev1_tree)])
@@ -215,7 +215,7 @@
# cache the parents of a parent tree at this point.
#repo.get_revision = self.fail
repo.get_inventory = self.fail
- repo.get_inventory_xml = self.fail
+ repo._get_inventory_xml = self.fail
# set the parent trees.
tree.set_parent_trees([(rev1, rev1_tree), (rev2, rev2_tree)])
# read the first tree
=== modified file 'bzrlib/workingtree.py'
--- a/bzrlib/workingtree.py 2010-01-21 17:54:58 +0000
+++ b/bzrlib/workingtree.py 2010-01-31 12:05:38 +0000
@@ -1904,7 +1904,7 @@
# revision_id is set. We must check for this full string, because a
# root node id can legitimately look like 'revision_id' but cannot
# contain a '"'.
- xml = self.branch.repository.get_inventory_xml(new_revision)
+ xml = self.branch.repository._get_inventory_xml(new_revision)
firstline = xml.split('\n', 1)[0]
if (not 'revision_id="' in firstline or
'format="7"' not in firstline):
More information about the bazaar-commits
mailing list