bzr log failure when filename specified and ghosts present.

Bug #209948 reported by Xavier Maillard on 2008-03-31
Affects Status Importance Assigned to Milestone
John A Meinel

Bug Description

With recent, bzr log will throw an exception if --limit argument is too high.

bzr log --limit=30 --short bzrlib/ fails when if can't find a parent revision.

Xavier Maillard (xma) wrote :

I guess it is a regression since this works perfectly with bzr 1.3

Xavier Maillard (xma) wrote :

bzr: ERROR: exceptions.KeyError: '<email address hidden>'

Traceback (most recent call last):
  File "/home/xma/usr/src/BZRed/bzr/", line 834, in run_bzr_catch_errors
    return run_bzr(argv)
  File "/home/xma/usr/src/BZRed/bzr/", line 790, in run_bzr
    ret = run(*run_argv)
  File "/home/xma/usr/src/BZRed/bzr/", line 492, in run_argv_aliases
  File "/home/xma/usr/src/BZRed/bzr/", line 800, in ignore_pipe
    result = func(*args, **kwargs)
  File "/home/xma/usr/src/BZRed/bzr/", line 1789, in run
  File "/home/xma/usr/src/BZRed/bzr/", line 185, in show_log
    start_revision, end_revision, search, limit)
  File "/home/xma/usr/src/BZRed/bzr/", line 215, in _show_log
  File "/home/xma/usr/src/BZRed/bzr/", line 282, in calculate_view_revisions
  File "/home/xma/usr/src/BZRed/bzr/", line 482, in _filter_revisions_touching_file_id
    rev_ancestry = rev_ancestry.union(ancestry[parent])
KeyError: '<email address hidden>'

bzr 1.4dev on python 2.5.1 (linux2)
arguments: ['/home/xma/usr/src/BZRed/bzr/', 'log', '--limit=30', '--short', 'bzrlib/']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'en_US.UTF-8'
  bzrtools /home/xma/.bazaar/plugins/bzrtools [1.3.0]
  fastimport /home/xma/.bazaar/plugins/fastimport [unknown]
  launchpad /home/xma/usr/src/BZRed/bzr/ [unknown]
*** Bazaar has encountered an internal error.
    Please report a bug at
    including this traceback, and a description of what you
    were doing when the error occurred

Andrew Bennetts (spiv) on 2008-04-01
Changed in bzr:
importance: Undecided → High
milestone: none → 1.4
status: New → Confirmed
Aaron Bentley (abentley) wrote :

This is a ghost handling issue. The code that determines whether a given file is affected by a revision may now encounter ghosts, but cannot handle them properly. The issue can be reproduced without using --limit or --short

Changed in bzr:
importance: High → Critical
John A Meinel (jameinel) wrote :

The fix is actually pretty trivial:

The _filter_revisions_touching_file_id just didn't handle the case where a parent could be referenced, but not already computed in the ancestry.

I'll put together a test, and submit it:
=== modified file 'bzrlib/'
--- bzrlib/ 2008-03-28 03:54:40 +0000
+++ bzrlib/ 2008-04-18 17:37:53 +0000
@@ -479,6 +479,8 @@
             if rev in weave_modifed_revisions:
             for parent in parents:
+ if parent not in ancestry: # Ghost
+ continue
                 rev_ancestry = rev_ancestry.union(ancestry[parent])
         ancestry[rev] = rev_ancestry

Changed in bzr:
assignee: nobody → jameinel
status: Confirmed → Fix Committed
Martin Pool (mbp) on 2008-04-21
Changed in bzr:
milestone: 1.4 → 1.4rc2
John A Meinel (jameinel) on 2008-05-29
Changed in bzr:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers