Rev 3376: (jam) bug #209948, in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Mon Apr 21 19:15:09 BST 2008


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 3376
revision-id:pqm at pqm.ubuntu.com-20080421181503-z5opy8fb01ksjc5w
parent: pqm at pqm.ubuntu.com-20080421032507-zw44l9w8k1riva6y
parent: john at arbash-meinel.com-20080421160533-abpkc2ahl7h5m3nl
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Mon 2008-04-21 19:15:03 +0100
message:
  (jam) bug #209948,
  	properly skip over ghosts when displaying the log for a single file
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/log.py                  log.py-20050505065812-c40ce11702fe5fb1
  bzrlib/tests/test_log.py       testlog.py-20050728115707-1a514809d7d49309
    ------------------------------------------------------------
    revno: 3373.2.2
    revision-id:john at arbash-meinel.com-20080421160533-abpkc2ahl7h5m3nl
    parent: john at arbash-meinel.com-20080418175434-t91cnuokuwovt1s6
    parent: pqm at pqm.ubuntu.com-20080421032507-zw44l9w8k1riva6y
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: log_bug_209948
    timestamp: Mon 2008-04-21 11:05:33 -0500
    message:
      resolve NEWS conflict
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
      bzrlib/plugins/launchpad/lp_directory.py lp_indirect.py-20070126012204-de5rugwlt22c7u7e-1
      bzrlib/smart/server.py         server.py-20061110062051-chzu10y32vx8gvur-1
    ------------------------------------------------------------
    revno: 3373.2.1
    revision-id:john at arbash-meinel.com-20080418175434-t91cnuokuwovt1s6
    parent: pqm at pqm.ubuntu.com-20080417155359-m3nxwwr442bgmsne
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: log_bug_209948
    timestamp: Fri 2008-04-18 12:54:34 -0500
    message:
      Fix bug #209948, properly skip over ghosts when displaying the changes for a single file.
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
      bzrlib/log.py                  log.py-20050505065812-c40ce11702fe5fb1
      bzrlib/tests/test_log.py       testlog.py-20050728115707-1a514809d7d49309
=== modified file 'NEWS'
--- a/NEWS	2008-04-21 01:07:17 +0000
+++ b/NEWS	2008-04-21 16:05:33 +0000
@@ -37,6 +37,9 @@
       every revision each side had in common.
       (Robert Collins, John Arbash Meinel)
 
+    * When logging the changes to a particular file, there was a bug if there
+      were ghosts in the revision ancestry. (John Arbash Meinel, #209948)
+
   DOCUMENTATION:
 
     * Document outlining strategies for TortoiseBzr. (Mark Hammond)

=== modified file 'bzrlib/log.py'
--- a/bzrlib/log.py	2008-03-28 03:54:40 +0000
+++ b/bzrlib/log.py	2008-04-18 17:54:34 +0000
@@ -479,6 +479,11 @@
             if rev in weave_modifed_revisions:
                 rev_ancestry.add(rev)
             for parent in parents:
+                if parent not in ancestry:
+                    # parent is a Ghost, which won't be present in
+                    # sorted_rev_list, but we may access it later, so create an
+                    # empty node for it
+                    ancestry[parent] = set()
                 rev_ancestry = rev_ancestry.union(ancestry[parent])
         ancestry[rev] = rev_ancestry
 

=== modified file 'bzrlib/tests/test_log.py'
--- a/bzrlib/tests/test_log.py	2008-03-26 21:42:35 +0000
+++ b/bzrlib/tests/test_log.py	2008-04-18 17:54:34 +0000
@@ -891,6 +891,20 @@
         # f3 should be marked as modified by revisions A, B, C, and D
         self.assertAllRevisionsForFileID(tree, 'f2-id', ['D', 'C', 'A'])
 
+    def test_file_id_with_ghosts(self):
+        # This is testing bug #209948, where having a ghost would cause
+        # _filter_revisions_touching_file_id() to fail.
+        tree = self.create_tree_with_single_merge()
+        # We need to add a revision, so switch back to a write-locked tree
+        tree.unlock()
+        tree.lock_write()
+        first_parent = tree.last_revision()
+        tree.set_parent_ids([first_parent, 'ghost-revision-id'])
+        self.build_tree_contents([('tree/f1', 'A\nB\nXX\n')])
+        tree.commit('commit with a ghost', rev_id='XX')
+        self.assertAllRevisionsForFileID(tree, 'f1-id', ['XX', 'B', 'A'])
+        self.assertAllRevisionsForFileID(tree, 'f2-id', ['D', 'C', 'A'])
+
 
 class TestShowChangedRevisions(TestCaseWithTransport):
 




More information about the bazaar-commits mailing list