bzr log failure when filename specified and ghosts present.

Bug #209948 reported by Xavier Maillard
10
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Critical
John A Meinel

Bug Description

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

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

Revision history for this message
Xavier Maillard (xma) wrote :

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

Revision history for this message
Xavier Maillard (xma) wrote :

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

Traceback (most recent call last):
  File "/home/xma/usr/src/BZRed/bzr/bzr.dev/bzrlib/commands.py", line 834, in run_bzr_catch_errors
    return run_bzr(argv)
  File "/home/xma/usr/src/BZRed/bzr/bzr.dev/bzrlib/commands.py", line 790, in run_bzr
    ret = run(*run_argv)
  File "/home/xma/usr/src/BZRed/bzr/bzr.dev/bzrlib/commands.py", line 492, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/home/xma/usr/src/BZRed/bzr/bzr.dev/bzrlib/commands.py", line 800, in ignore_pipe
    result = func(*args, **kwargs)
  File "/home/xma/usr/src/BZRed/bzr/bzr.dev/bzrlib/builtins.py", line 1789, in run
    limit=limit)
  File "/home/xma/usr/src/BZRed/bzr/bzr.dev/bzrlib/log.py", line 185, in show_log
    start_revision, end_revision, search, limit)
  File "/home/xma/usr/src/BZRed/bzr/bzr.dev/bzrlib/log.py", line 215, in _show_log
    allow_single_merge_revision)
  File "/home/xma/usr/src/BZRed/bzr/bzr.dev/bzrlib/log.py", line 282, in calculate_view_revisions
    view_revisions)
  File "/home/xma/usr/src/BZRed/bzr/bzr.dev/bzrlib/log.py", 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/bzr.dev/bzr', 'log', '--limit=30', '--short', 'bzrlib/mail_client.py']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'en_US.UTF-8'
plugins:
  bzrtools /home/xma/.bazaar/plugins/bzrtools [1.3.0]
  fastimport /home/xma/.bazaar/plugins/fastimport [unknown]
  launchpad /home/xma/usr/src/BZRed/bzr/bzr.dev/bzrlib/plugins/launchpad [unknown]
*** Bazaar has encountered an internal error.
    Please report a bug at https://bugs.launchpad.net/bzr/+filebug
    including this traceback, and a description of what you
    were doing when the error occurred

Andrew Bennetts (spiv)
Changed in bzr:
importance: Undecided → High
milestone: none → 1.4
status: New → Confirmed
Revision history for this message
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
Revision history for this message
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/log.py'
--- bzrlib/log.py 2008-03-28 03:54:40 +0000
+++ bzrlib/log.py 2008-04-18 17:37:53 +0000
@@ -479,6 +479,8 @@
             if rev in weave_modifed_revisions:
                 rev_ancestry.add(rev)
             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)
Changed in bzr:
milestone: 1.4 → 1.4rc2
John A Meinel (jameinel)
Changed in bzr:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.