[merge][#295350] fix another "revision not present" in stacked repositories
mbp at canonical.com
Thu Nov 20 12:33:39 GMT 2008
This is a rolled-up patch of stacking fixes but the new part is this.
I think the comments are pretty self-explanatory.
=== modified file 'bzrlib/knit.py'
--- bzrlib/knit.py 2008-11-20 03:47:45 +0000
+++ bzrlib/knit.py 2008-11-20 12:26:18 +0000
@@ -1442,9 +1442,11 @@
is an iterator).
- * Lines are normalised by the underlying store: they will all have \n
+ * Lines are normalised by the underlying store: they will all have \\n
* Lines are returned in arbitrary order.
+ * If a requested key did not change any lines (or didn't have any
+ lines), it may not be mentioned at all in the result.
:return: An iterator over (line, key).
@@ -1476,6 +1478,14 @@
# change to integrate into the rest of the codebase. RBC 20071110
for line in line_iterator:
yield line, key
+ # If there are still keys we've not yet found, we look in the fallback
+ # vfs, and hope to find them there. Note that if the keys are found
+ # but had no changes or no content, the fallback may not return
+ # anything.
+ if keys and not self._fallback_vfs:
+ # XXX: strictly the second parameter is meant to be the file id
+ # but it's not easily accessible here.
+ raise RevisionNotPresent(keys, repr(self))
for source in self._fallback_vfs:
if not keys:
@@ -1484,10 +1494,6 @@
yield line, key
- if keys:
- # XXX: strictly the second parameter is meant to be the file id
- # but it's not easily accessible here.
- raise RevisionNotPresent(keys, repr(self))
pb.update('Walking content.', total, total)
def _make_line_delta(self, delta_seq, new_content):
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 45418 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20081120/ebbcb239/attachment-0001.bin
More information about the bazaar