Rev 4012: Review feedback. in http://people.ubuntu.com/~robertc/baz2.0/versioned_files.network
Robert Collins
robertc at robertcollins.net
Fri Feb 20 06:00:25 GMT 2009
At http://people.ubuntu.com/~robertc/baz2.0/versioned_files.network
------------------------------------------------------------
revno: 4012
revision-id: robertc at robertcollins.net-20090220060022-682t76tgrlj1x0ri
parent: robertc at robertcollins.net-20090217062152-8j02ev4tjhaidj54
committer: Robert Collins <robertc at robertcollins.net>
branch nick: VersionedFiles.NetworkRecordStream
timestamp: Fri 2009-02-20 17:00:22 +1100
message:
Review feedback.
=== modified file 'bzrlib/knit.py'
--- a/bzrlib/knit.py 2009-02-17 06:21:52 +0000
+++ b/bzrlib/knit.py 2009-02-20 06:00:22 +0000
@@ -1179,7 +1179,7 @@
# we have successfully found, and then only request the new records
# from there. However, _get_components_positions grabs the whole build
# chain, which means we'll likely try to grab the same records again
- # anyway. Also, can the build chains change as art of a pack
+ # anyway. Also, can the build chains change as part of a pack
# operation? We wouldn't want to end up with a broken chain.
while True:
try:
@@ -1840,6 +1840,8 @@
def _get_content(self, key):
"""Get the content object for key."""
+ # Note that _get_content is only called when the _ContentMapGenerator
+ # has been constructed with just one key requested for reconstruction.
if key in self.nonlocal_keys:
record = self.get_record_stream().next()
# Create a content object on the fly
@@ -1897,7 +1899,7 @@
# desired text.
if requested_key in self._contents_map:
return self._contents_map[requested_key]
- # To simply things, parse everything at once - code that wants one text
+ # To simplify things, parse everything at once - code that wants one text
# probably wants them all.
# FUTURE: This function could be improved for the 'extract many' case
# by tracking each component and only doing the copy when the number of
=== modified file 'bzrlib/tests/test_versionedfile.py'
--- a/bzrlib/tests/test_versionedfile.py 2009-02-17 06:21:52 +0000
+++ b/bzrlib/tests/test_versionedfile.py 2009-02-20 06:00:22 +0000
@@ -1712,7 +1712,7 @@
def assertRecordHasContent(self, record, bytes):
"""Assert that record has the bytes bytes."""
self.assertEqual(bytes, record.get_bytes_as('fulltext'))
- self.assertEqual(bytes, ''.join(record.get_bytes_as('fulltext')))
+ self.assertEqual(bytes, ''.join(record.get_bytes_as('chunked')))
def test_get_record_stream_native_formats_are_wire_ready_one_ft(self):
files = self.get_versionedfiles()
=== modified file 'bzrlib/versionedfile.py'
--- a/bzrlib/versionedfile.py 2009-02-17 06:21:52 +0000
+++ b/bzrlib/versionedfile.py 2009-02-20 06:00:22 +0000
@@ -40,7 +40,6 @@
)
from bzrlib.graph import DictParentsProvider, Graph, _StackedParentsProvider
from bzrlib.transport.memory import MemoryTransport
-from bzrlib.util import bencode
""")
from bzrlib.inter import InterObject
from bzrlib.registry import Registry
More information about the bazaar-commits
mailing list