Traceback from 'bzr log -r0'

Bug #133751 reported by John A Meinel
4
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Medium
Unassigned

Bug Description

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I wouldn't really expect 'bzr log -r0' to work, but it shouldn't give an ugly
traceback.

bzr: ERROR: exceptions.ValueError: list.index(x): x not in list

Traceback (most recent call last):
  File "/Users/jameinel/dev/bzr/bzr.dev/bzrlib/commands.py", line 781, in
run_bzr_catch_errors
    return run_bzr(argv)
  File "/Users/jameinel/dev/bzr/bzr.dev/bzrlib/commands.py", line 743, in run_bzr
    ret = run(*run_argv)
  File "/Users/jameinel/dev/bzr/bzr.dev/bzrlib/commands.py", line 475, in
run_argv_aliases
    return self.run(**all_cmd_args)
  File "/Users/jameinel/dev/bzr/bzr.dev/bzrlib/commands.py", line 753, in
ignore_pipe
    result = func(*args, **kwargs)
  File "/Users/jameinel/dev/bzr/bzr.dev/bzrlib/builtins.py", line 1717, in run
    limit=limit)
  File "/Users/jameinel/dev/bzr/bzr.dev/bzrlib/log.py", line 170, in show_log
    start_revision, end_revision, search, limit)
  File "/Users/jameinel/dev/bzr/bzr.dev/bzrlib/log.py", line 236, in _show_log
    end_rev_id)
  File "/Users/jameinel/dev/bzr/bzr.dev/bzrlib/log.py", line 398, in
_filter_revision_range
    start_index = revision_ids.index(start_rev_id)
ValueError: list.index(x): x not in list

bzr 0.91.0dev0 on python 2.4.3.final.0 (darwin)
arguments: ['/Users/jameinel/bin/bzr', 'log', '-r0', '--long']

Note, we also get bad tracebacks like this from:
bzr log --short -r revid:not-in-mainline

 affects /products/bzr
 status triaged
 importance medium
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGygeFJdeBCYSNAAMRApCtAKCkUm3ER32mx9JxbG+fRDbuEjaMUwCgkGjk
9RmXo8+NNRa+Bzejt/1t89A=
=5hjp
-----END PGP SIGNATURE-----

Revision history for this message
John A Meinel (jameinel) wrote :

This seems to be introduced by:
2733 Canonical.com Patch Queue Manager 2007-08-20 [merge]
      NULL_REVISION is returned to indicate the null revision, not None

bzr <0.17 gives:
bzr: ERROR: Invalid revision number 0

bzr 0.18, and 0.90rc1 treat '0' as though you didn't specify a value (as None). So

bzr log -r 0..10
is the same as
bzr log -r ..10

Unfortunately that means that
bzr log -r 0
Actually gives you the whole history
(It is equivalent to bzr log, or bzr log -r .., or bzr log -r 0..0)

bzr.dev after 2733 gives a index lookup failure, along with traceback.

Revision history for this message
Martin Albisetti (beuno) wrote :

I've just upgraded my production server from bzr 0.90 to bzr 0.91 to gain a bit on performance and help out in testing, but the current scripts I had running use "bzr log -r 0.." in some cases, and now they're all crying because of this bug.

Is there any workaround in progress?

Revision history for this message
John A Meinel (jameinel) wrote :

Well, you can just use "bzr log -r ..X" instead. Or "bzr log 1.."

You just need to not use the value '0'

Kent Gibson (warthog618)
Changed in bzr:
assignee: nobody → warthog618
status: Triaged → In Progress
Kent Gibson (warthog618)
Changed in bzr:
status: In Progress → Fix Committed
Aaron Bentley (abentley)
Changed in bzr:
milestone: none → 1.0rc1
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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