"bzr log --forward FILE" crashes for revision range if first revision is not mainline

Bug #300055 reported by Sven Sandberg
2
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Medium
Vincent Ladeuil

Bug Description

When running 'bzr log -rREVID --forward FILE', for a specific REVID and FILE in mysql, bzr crashes. The crash goes away if I use other REVIDs, or if I omit --forward, or if I omit FILE.

Steps to repeat:

$ bzr branch lp:mysql-server/6.0 mysql-6.0
You have not informed bzr of your launchpad login. If you are attempting a
write operation and it fails, run "bzr launchpad-login YOUR_ID" and try again.
Branched 2792 revision(s).

$ cd mysql-6.0

$ bzr log -l1 --show-ids
------------------------------------------------------------
revno: 2792
revision-id: <email address hidden>
parent: <email address hidden>
parent: <email address hidden>
committer: Jorgen Loland <email address hidden>
branch nick: mysql-6.0
timestamp: Fri 2008-11-14 14:44:11 +0100
message:
  Merge mysql-6.0-backup-merge -> mysql-6.0

$ bzr log '-rrevid:<email address hidden>..' --show-ids --forward mysql-test/t/subselect.test
bzr: ERROR: exceptions.IndexError: list index out of range

Traceback (most recent call last):
  File "/home/sven/bzr/bzr/bzr.dev/bzrlib/commands.py", line 893, in run_bzr_catch_errors
    return run_bzr(argv)
  File "/home/sven/bzr/bzr/bzr.dev/bzrlib/commands.py", line 839, in run_bzr
    ret = run(*run_argv)
  File "/home/sven/bzr/bzr/bzr.dev/bzrlib/commands.py", line 539, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/home/sven/bzr/bzr/bzr.dev/bzrlib/commands.py", line 853, in ignore_pipe
    result = func(*args, **kwargs)
  File "/home/sven/bzr/bzr/bzr.dev/bzrlib/builtins.py", line 1873, in run
    limit=limit)
  File "/home/sven/bzr/bzr/bzr.dev/bzrlib/log.py", line 182, in show_log
    start_revision, end_revision, search, limit)
  File "/home/sven/bzr/bzr/bzr.dev/bzrlib/log.py", line 212, in _show_log
    allow_single_merge_revision)
  File "/home/sven/bzr/bzr/bzr.dev/bzrlib/log.py", line 272, in calculate_view_revisions
    direction)
  File "/home/sven/bzr/bzr/bzr.dev/bzrlib/log.py", line 599, in _filter_revisions_touching_file_id
    view_revisions = reverse_by_depth(view_revisions)
  File "/home/sven/bzr/bzr/bzr.dev/bzrlib/log.py", line 674, in reverse_by_depth
    zd_revisions[-1].append(val)
IndexError: list index out of range

bzr 1.10dev on python 2.5.2 (linux2)
arguments: ['/home/sven/bin/bd', 'log', '-rrevid:<email address hidden>..', '--show-ids', '--forward', 'mysql-test/t/subselect.test']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'en_US.UTF-8'
plugins:
  bzrtools /usr/lib/python2.5/site-packages/bzrlib/plugins/bzrtools [1.8]
  danny_plugins /home/sven/.bazaar/plugins/danny_plugins [unknown]
  difftools /home/sven/.bazaar/plugins/difftools [0.91]
  extmerge /home/sven/.bazaar/plugins/extmerge [unknown]
  gtk /home/sven/.bazaar/plugins/gtk [0.96.0.dev.1]
  launchpad /home/sven/bzr/bzr/bzr.dev/bzrlib/plugins/launchpad [unknown]
  mysql_merge /home/sven/.bazaar/plugins/mysql_merge [0.1]
  mysql_plugins /home/sven/.bazaar/plugins/mysql_plugins [0.4]
  per_file_remerge /home/sven/.bazaar/plugins/per_file_remerge [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.

$ bzr version
Bazaar (bzr) 1.10dev
  from bzr checkout /home/sven/bzr/bzr/bzr.dev
    revision: 3841
    revid: <email address hidden>
    branch nick: bzr.dev
  Python interpreter: /usr/bin/python 2.5.2
  Python standard library: /usr/lib/python2.5
  bzrlib: /home/sven/bzr/bzr/bzr.dev/bzrlib
  Bazaar configuration: /home/sven/.bazaar
  Bazaar log file: /home/sven/.bzr.log

Copyright 2005, 2006, 2007, 2008 Canonical Ltd.
http://bazaar-vcs.org/

bzr comes with ABSOLUTELY NO WARRANTY. bzr is free software, and
you may use, modify and redistribute it under the terms of the GNU
General Public License version 2 or later.

Tags: mysql
Vincent Ladeuil (vila)
Changed in bzr:
assignee: nobody → vila
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Vincent Ladeuil (vila) wrote :

I just updated the description of the bug to outline that the bug is that, when the first revision is not a mainline one, we fail to properly identify the merges towards mainline since they are outside the requested revision range.

Revision history for this message
Vincent Ladeuil (vila) wrote :

It turns out this bug is more tricky than it appears at first glance :)

Two first fixes are available in the associated branch, which addresses the bug reported here, but fixing that reveals more problems.

Roughly speaking the problem is that we present log entries attached to their mainline revisions and chronoligically sorted by depth *but* whatever the sort order is requested, merged revisions always appear *after* the mainline revision they were merged into.

This is fine (or at least as become the standard usage) as long as the revision range to be displayed starts and ends at a mainline revision (given that, when displayed, the end revision will nevertheless appears *before* the revisions that it merges).

Things are not that well defined when the start or end revision is a dotted one.

Changed in bzr:
status: Confirmed → In Progress
Vincent Ladeuil (vila)
Changed in bzr:
milestone: none → 1.10rc1
status: In Progress → 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.