unshelve --dry-run crashes and leaves the repository locked

Bug #330248 reported by Wesley J. Landaker
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Medium
Unassigned

Bug Description

With the latest bzr.dev (r4010) unshelve --dry-run crashes and leaves the repository locked. To continue requires doing a break-lock and then doing an unshelve *without* --dry-run.

$ bzr unshelve --dry-run
Unshelving changes with id "1".
Message: Add test.
bzr: ERROR: exceptions.IndexError: list index out of range

Traceback (most recent call last):
  File "/home/wjlanda/lib/python/bzrlib/commands.py", line 921, in run_bzr_catch_errors
    return run_bzr(argv)
  File "/home/wjlanda/lib/python/bzrlib/commands.py", line 866, in run_bzr
    ret = run(*run_argv)
  File "/home/wjlanda/lib/python/bzrlib/commands.py", line 547, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/home/wjlanda/lib/python/bzrlib/builtins.py", line 5193, in run
    Unshelver.from_args(shelf_id, action).run()
  File "/home/wjlanda/lib/python/bzrlib/shelf_ui.py", line 287, in run
    self.show_changes(merger)
  File "/home/wjlanda/lib/python/bzrlib/shelf_ui.py", line 298, in show_changes
    tt = tree_merger.make_preview_transform()
  File "/home/wjlanda/lib/python/bzrlib/merge.py", line 622, in make_preview_transform
    self.pp.next_phase()
  File "/home/wjlanda/lib/python/bzrlib/progress.py", line 633, in next_phase
    self.pb.update(self.message, self.cur_phase, self.total)
  File "/home/wjlanda/lib/python/bzrlib/progress.py", line 97, in update
    self.ui_factory._progress_updated(self)
  File "/home/wjlanda/lib/python/bzrlib/ui/text.py", line 94, in _progress_updated
    if task != self._task_stack[-1]:
IndexError: list index out of range

bzr 1.13dev on python 2.5.2 (linux2)
arguments: ['/home/wjlanda/bin/bzr', 'unshelve', '--dry-run']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'en_US.UTF-8'
plugins:
  bisect /home/wjlanda/.bazaar/plugins/bisect [1.1.0.pre.0]
  bookmarks /home/wjlanda/.bazaar/plugins/bookmarks [unknown]
  bzrtools /usr/lib/python2.5/site-packages/bzrlib/plugins/bzrtools [1.12]
  cvsps_import /usr/lib/python2.5/site-packages/bzrlib/plugins/cvsps_import [unknown]
  diffstat /home/wjlanda/.bazaar/plugins/diffstat [0.2]
  extcommand /home/wjlanda/.bazaar/plugins/extcommand [unknown]
  gtk /home/wjlanda/.bazaar/plugins/gtk [0.96.0.dev.1]
  interactive /home/wjlanda/.bazaar/plugins/interactive [1.2]
  launchpad /home/wjlanda/lib/python/bzrlib/plugins/launchpad [unknown]
  netrc_credential_store /home/wjlanda/lib/python/bzrlib/plugins/netrc_credential_store [unknown]
  qbzr /home/wjlanda/.bazaar/plugins/qbzr [0.9.9dev]
  rebase /usr/lib/python2.5/site-packages/bzrlib/plugins/rebase [0.4.2]
  search /home/wjlanda/.bazaar/plugins/search [1.7dev]
  stats /usr/lib/python2.5/site-packages/bzrlib/plugins/stats [unknown]
  svn /home/wjlanda/lib/python/bzrlib/plugins/svn [0.5.1dev]
  upload /usr/lib/python2.5/site-packages/bzrlib/plugins/upload [0.1]
  xmloutput /home/wjlanda/.bazaar/plugins/xmloutput [0.8.3]
*** 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.

Tags: shelf

Related branches

Revision history for this message
Wesley J. Landaker (wjl) wrote :

Possibly related, bzr unshelve spits out warnings even when it does work:

$ bzr unshelve --apply
Unshelving changes with id "1".
/home/wjlanda/lib/python/bzrlib/ui/text.py:96: UserWarning: ProgressTask(0/3, msg='Merge phase') is not the top progress task ProgressTask(None/None, msg='')
  (task, self._task_stack[-1]))
/home/wjlanda/lib/python/bzrlib/ui/text.py:96: UserWarning: ProgressTask(1/3, msg='Merge phase') is not the top progress task ProgressTask(None/None, msg='')
  (task, self._task_stack[-1]))
 M A
 M B
 M C
 M D
/home/wjlanda/lib/python/bzrlib/ui/text.py:96: UserWarning: ProgressTask(2/3, msg='Merge phase') is not the top progress task ProgressTask(None/None, msg='')
  (task, self._task_stack[-1]))
All changes applied successfully.

Revision history for this message
Arvid Norlander (vorpalblade) wrote :

Ran into same issue with 1.12:
bzr: ERROR: exceptions.IndexError: list index out of range

Traceback (most recent call last):
  File "//usr/lib64/python2.5/site-packages/bzrlib/commands.py", line 896, in run_bzr_catch_errors
    return run_bzr(argv)
  File "//usr/lib64/python2.5/site-packages/bzrlib/commands.py", line 842, in run_bzr
    ret = run(*run_argv)
  File "//usr/lib64/python2.5/site-packages/bzrlib/commands.py", line 542, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "//usr/lib64/python2.5/site-packages/bzrlib/builtins.py", line 5182, in run
    Unshelver.from_args(shelf_id, action).run()
  File "//usr/lib64/python2.5/site-packages/bzrlib/shelf_ui.py", line 284, in run
    self.show_changes(merger)
  File "//usr/lib64/python2.5/site-packages/bzrlib/shelf_ui.py", line 295, in show_changes
    tt = tree_merger.make_preview_transform()
  File "//usr/lib64/python2.5/site-packages/bzrlib/merge.py", line 622, in make_preview_transform
    self.pp.next_phase()
  File "//usr/lib64/python2.5/site-packages/bzrlib/progress.py", line 633, in next_phase
    self.pb.update(self.message, self.cur_phase, self.total)
  File "//usr/lib64/python2.5/site-packages/bzrlib/progress.py", line 97, in update
    self.ui_factory._progress_updated(self)
  File "//usr/lib64/python2.5/site-packages/bzrlib/ui/text.py", line 94, in _progress_updated
    if task != self._task_stack[-1]:
IndexError: list index out of range

bzr 1.12 on python 2.5.2 (linux2)
arguments: ['/usr/bin/bzr', 'unshelve', '--dry-run', '1']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'sv_SE.UTF-8'
plugins:
  bzrtools /usr/lib64/python2.5/site-packages/bzrlib/plugins/bzrtools [1.12]
  launchpad /usr/lib64/python2.5/site-packages/bzrlib/plugins/launchpad [unknown]
  netrc_credential_store /usr/lib64/python2.5/site-packages/bzrlib/plugins/netrc_credential_store [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.

Again the repo was locked afterwards.

Revision history for this message
Martin Pool (mbp) wrote :

I think there are two problems here:

A duplicate of 303568 means the tree is left locked if an exception occurs.

And there is a bug in either the progress code or in how unshelve calls it.

Changed in bzr:
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Martin Pool (mbp) wrote :

Progress bar issue fixed in https://code.edge.launchpad.net/~mbp/bzr/progress, other parts in bug 303568.

Changed in bzr:
status: Confirmed → In Progress
Jelmer Vernooij (jelmer)
tags: added: shelf
Changed in bzr:
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.