Rev 3372: Review feedback. in http://people.ubuntu.com/~robertc/baz2.0/versioned_files
Robert Collins
robertc at robertcollins.net
Mon May 12 02:23:49 BST 2008
At http://people.ubuntu.com/~robertc/baz2.0/versioned_files
------------------------------------------------------------
revno: 3372
revision-id: robertc at robertcollins.net-20080512012341-vzjmv73r8b96eumr
parent: robertc at robertcollins.net-20080511234950-pfiipsq0r45lbxqd
committer: Robert Collins <robertc at robertcollins.net>
branch nick: data_stream_revamp
timestamp: Mon 2008-05-12 11:23:41 +1000
message:
Review feedback.
modified:
bzrlib/fetch.py fetch.py-20050818234941-26fea6105696365d
bzrlib/knit.py knit.py-20051212171256-f056ac8f0fbe1bd9
bzrlib/tests/test_versionedfile.py test_versionedfile.py-20060222045249-db45c9ed14a1c2e5
bzrlib/versionedfile.py versionedfile.py-20060222045106-5039c71ee3b65490
=== modified file 'bzrlib/fetch.py'
--- a/bzrlib/fetch.py 2008-05-11 23:49:50 +0000
+++ b/bzrlib/fetch.py 2008-05-12 01:23:41 +0000
@@ -217,8 +217,8 @@
from_weave = self.from_weaves.get_weave(file_id,
self.from_repository.get_transaction())
# Fetch all the texts.
- to_weave.insert_record_stream(from_weave.get_record_stream(required_versions,
- 'topological', False))
+ to_weave.insert_record_stream(from_weave.get_record_stream(
+ required_versions, 'topological', False))
def _fetch_inventory_weave(self, revs, pb):
pb.update("fetch inventory", 0, 2)
=== modified file 'bzrlib/knit.py'
--- a/bzrlib/knit.py 2008-05-11 23:49:50 +0000
+++ b/bzrlib/knit.py 2008-05-12 01:23:41 +0000
@@ -882,7 +882,8 @@
knit = self
else:
knit = None
- # Double index lookups here : need a unified api ?
+ # We end up doing multiple index lookups here for parents details and
+ # disk layout details - we need a unified api ?
parent_map = self.get_parent_map(versions)
absent_versions = set(versions) - set(parent_map)
if ordering == 'topological':
@@ -894,7 +895,6 @@
present_versions = [version for version in versions if version in
parent_map]
position_map = self._get_components_positions(present_versions)
- # c = component_id, r = record_details, i_m = index_memo, n = next
records = [(version, position_map[version][1]) for version in
present_versions]
record_map = {}
@@ -1101,17 +1101,18 @@
annotated = ""
convertibles = set(["knit-annotated-delta-gz",
"knit-annotated-ft-gz"])
+ # The set of types we can cheaply adapt without needing basis texts.
native_types = set()
native_types.add("knit-%sdelta-gz" % annotated)
native_types.add("knit-%sft-gz" % annotated)
knit_types = native_types.union(convertibles)
adapters = {}
- # Buffered index entries that we can't add immediately because their
+ # Buffer all index entries that we can't add immediately because their
# basis parent is missing. We don't buffer all because generating
# annotations may require access to some of the new records. However we
# can't generate annotations from new deltas until their basis parent
# is present anyway, so we get away with not needing an index that
- # reports on the new keys.
+ # includes the new keys.
# key = basis_parent, value = index entry to add
buffered_index_entries = {}
for record in stream:
=== modified file 'bzrlib/tests/test_versionedfile.py'
--- a/bzrlib/tests/test_versionedfile.py 2008-04-30 04:13:51 +0000
+++ b/bzrlib/tests/test_versionedfile.py 2008-05-12 01:23:41 +0000
@@ -142,7 +142,7 @@
str)
def test_get_record_stream_interface(self):
- """each item in a stream has to provide a regular interface."""
+ """Each item in a stream has to provide a regular interface."""
f, parents = get_diamond_vf(self.get_file())
entries = f.get_record_stream(['merged', 'left', 'right', 'base'],
'unordered', False)
@@ -152,7 +152,7 @@
seen)
def test_get_record_stream_interface_ordered(self):
- """each item in a stream has to provide a regular interface."""
+ """Each item in a stream has to provide a regular interface."""
f, parents = get_diamond_vf(self.get_file())
entries = f.get_record_stream(['merged', 'left', 'right', 'base'],
'topological', False)
@@ -165,7 +165,7 @@
))
def test_get_record_stream_interface_ordered_with_delta_closure(self):
- """each item in a stream has to provide a regular interface."""
+ """Each item in a stream has to provide a regular interface."""
f, parents = get_diamond_vf(self.get_file())
entries = f.get_record_stream(['merged', 'left', 'right', 'base'],
'topological', True)
@@ -1571,7 +1571,7 @@
create=True, factory=factory)
def helpGetBytes(self, f, ft_adapter, delta_adapter):
- """grab the interested adapted texts for tests."""
+ """Grab the interested adapted texts for tests."""
# origin is a fulltext
entries = f.get_record_stream(['origin'], 'unordered', False)
base = entries.next()
=== modified file 'bzrlib/versionedfile.py'
--- a/bzrlib/versionedfile.py 2008-05-11 23:49:50 +0000
+++ b/bzrlib/versionedfile.py 2008-05-12 01:23:41 +0000
@@ -136,7 +136,9 @@
sorted stream has compression parents strictly before their
children.
:param include_delta_closure: If True then the closure across any
- compression parents will be included (in the opaque data).
+ compression parents will be included (in the data content of the
+ stream, not in the emitted records). This guarantees that
+ 'fulltext' can be used successfully on every record.
:return: An iterator of ContentFactory objects, each of which is only
valid until the iterator is advanced.
"""
More information about the bazaar-commits
mailing list