Rev 4186: Allows bzr log <FILE> in empty branches in http://bazaar.launchpad.net/%7Evila/bzr/integration

Vincent Ladeuil v.ladeuil+lp at free.fr
Mon Mar 23 14:57:44 GMT 2009


At http://bazaar.launchpad.net/%7Evila/bzr/integration

------------------------------------------------------------
revno: 4186
revision-id: v.ladeuil+lp at free.fr-20090323145522-4q589a1hm0xza1mb
parent: v.ladeuil+lp at free.fr-20090323144826-9q4k10wq1dc3u9u6
parent: v.ladeuil+lp at free.fr-20090323145146-ereu04up70b4kssz
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: integration
timestamp: Mon 2009-03-23 15:55:22 +0100
message:
  Allows bzr log <FILE> in empty branches
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/log.py                  log.py-20050505065812-c40ce11702fe5fb1
  bzrlib/tests/test_log.py       testlog.py-20050728115707-1a514809d7d49309
    ------------------------------------------------------------
    revno: 4183.3.2
    revision-id: v.ladeuil+lp at free.fr-20090323145146-ereu04up70b4kssz
    parent: v.ladeuil+lp at free.fr-20090323100600-jhgg8eiz4afcsi1l
    committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
    branch nick: 346431-log-unversioned-file
    timestamp: Mon 2009-03-23 15:51:46 +0100
    message:
      Add NEWS entry
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
    ------------------------------------------------------------
    revno: 4183.3.1
    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.
    modified:
      bzrlib/log.py                  log.py-20050505065812-c40ce11702fe5fb1
      bzrlib/tests/test_log.py       testlog.py-20050728115707-1a514809d7d49309
-------------- next part --------------
=== modified file 'NEWS'
--- a/NEWS	2009-03-23 14:48:26 +0000
+++ b/NEWS	2009-03-23 14:55:22 +0000
@@ -318,6 +318,9 @@
 Bug Fixes
 *********
 
+* Allows ``bzr log <FILE>`` to be called in an empty branch without
+  backtracing. (Vincent Ladeuil, #346431)
+
 * Bazaar now gives a better message including the filename if it's
   unable to read a file in the working directory, for example because
   of a permission error.  (Martin Pool, #338653)

=== 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