Rev 2775: Unbreak pack to pack fetching properly, with missing-text detection really working. in http://people.ubuntu.com/~robertc/baz2.0/repository
Robert Collins
robertc at robertcollins.net
Sun Sep 23 22:04:48 BST 2007
At http://people.ubuntu.com/~robertc/baz2.0/repository
------------------------------------------------------------
revno: 2775
revision-id: robertc at robertcollins.net-20070923210437-epdjo8vdvrc3jbsz
parent: robertc at robertcollins.net-20070923204634-qvl1z0wlcxom08h5
committer: Robert Collins <robertc at robertcollins.net>
branch nick: repository
timestamp: Mon 2007-09-24 07:04:37 +1000
message:
Unbreak pack to pack fetching properly, with missing-text detection really working.
modified:
bzrlib/repofmt/pack_repo.py pack_repo.py-20070813041115-gjv5ma7ktfqwsjgn-1
=== modified file 'bzrlib/repofmt/pack_repo.py'
--- a/bzrlib/repofmt/pack_repo.py 2007-09-23 09:45:10 +0000
+++ b/bzrlib/repofmt/pack_repo.py 2007-09-23 21:04:37 +0000
@@ -326,17 +326,22 @@
time.time() - start_time)
# select text keys
text_nodes = self._index_contents(text_index_map, text_filter)
- # We could return the keys copied as part of the return value from
- # _copy_nodes_graph but this doesn't work all that well with the need
- # to get line output too, so we check separately, and as we're going to
- # buffer everything anyway, we check beforehand, which saves reading
- # knit data over the wire when we know there are mising records.
- text_nodes = set(text_nodes)
- missing_text_keys = set(text_filter) - text_nodes
- if missing_text_keys:
- # TODO: raise a specific error that can handle many missing keys.
- a_missing_key = missing_text_keys.pop()
- raise errors.RevisionNotPresent(a_missing_key[1], a_missing_key[0])
+ if text_filter is not None:
+ # We could return the keys copied as part of the return value from
+ # _copy_nodes_graph but this doesn't work all that well with the
+ # need to get line output too, so we check separately, and as we're
+ # going to buffer everything anyway, we check beforehand, which
+ # saves reading knit data over the wire when we know there are
+ # mising records.
+ text_nodes = set(text_nodes)
+ present_text_keys = set(_node[1] for _node in text_nodes)
+ missing_text_keys = set(text_filter) - present_text_keys
+ if missing_text_keys:
+ # TODO: raise a specific error that can handle many missing
+ # keys.
+ a_missing_key = missing_text_keys.pop()
+ raise errors.RevisionNotPresent(a_missing_key[1],
+ a_missing_key[0])
# copy text keys and adjust values
list(self._copy_nodes_graph(text_nodes, text_index_map, writer,
text_index))
More information about the bazaar-commits
mailing list