Rev 4184: Fix bug #346431 by allowing log._filter_revisions_touching_file_id to be in file:///net/bigmamac/Volumes/home/vila/src/bzr/bugs/346431-log-unversioned-file/
Vincent Ladeuil
v.ladeuil+lp at free.fr
Mon Mar 23 10:06:03 GMT 2009
At file:///net/bigmamac/Volumes/home/vila/src/bzr/bugs/346431-log-unversioned-file/
------------------------------------------------------------
revno: 4184
revision-id: v.ladeuil+lp at free.fr-20090323100600-jhgg8eiz4afcsi1l
parent: pqm at pqm.ubuntu.com-20090323043327-txb4jri5i3gssuj5
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: 346431-log-unversioned-file
timestamp: Mon 2009-03-23 11:06:00 +0100
message:
Fix bug #346431 by allowing log._filter_revisions_touching_file_id to be
called on an empty branch.
* bzrlib/tests/test_log.py:
(TestGetRevisionsTouchingFileID.test_empty_branch_unknown_file_id):
Reproduce bug #346431 by trying to log an unknown file in an empty
branch.
* bzrlib/log.py:
(_filter_revisions_touching_file_id): Initialize next_keys so we
can 'del' it later.
-------------- next part --------------
=== modified file 'bzrlib/log.py'
--- a/bzrlib/log.py 2009-03-13 00:13:11 +0000
+++ b/bzrlib/log.py 2009-03-23 10:06:00 +0000
@@ -954,6 +954,7 @@
# Lookup all possible text keys to determine which ones actually modified
# the file.
text_keys = [(file_id, rev_id) for rev_id, revno, depth in view_revisions]
+ next_keys = None
# Looking up keys in batches of 1000 can cut the time in half, as well as
# memory consumption. GraphIndex *does* like to look for a few keys in
# parallel, it just doesn't like looking for *lots* of keys in parallel.
=== modified file 'bzrlib/tests/test_log.py'
--- a/bzrlib/tests/test_log.py 2009-02-27 15:14:34 +0000
+++ b/bzrlib/tests/test_log.py 2009-03-23 10:06:00 +0000
@@ -1499,6 +1499,14 @@
self.assertAllRevisionsForFileID(tree, 'f1-id', ['XX', 'B', 'A'])
self.assertAllRevisionsForFileID(tree, 'f2-id', ['D', 'C', 'A'])
+ def test_unknown_file_id(self):
+ tree = self.create_tree_with_single_merge()
+ self.assertAllRevisionsForFileID(tree, 'unknown', [])
+
+ def test_empty_branch_unknown_file_id(self):
+ tree = self.make_branch_and_tree('tree')
+ self.assertAllRevisionsForFileID(tree, 'unknown', [])
+
class TestShowChangedRevisions(tests.TestCaseWithTransport):
More information about the bazaar-commits
mailing list