status can't find a shelf manager on a revision tree

Bug #662053 reported by Rory Yorke
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Critical
John A Meinel

Bug Description

Appears to have been introduced in -r5444. There's apparently no test to catch this;
" bzr --no-plugins selftest 'blackbox.*status' " passes.

bug is present up to current tip, r5504.

rory@rory-laptop:~/hack/bzr/bzr.dev$ ./bzr --no-plugins up -r-61
 M NEWS
 M bzrlib/shelf.py
 M bzrlib/status.py
 M bzrlib/tests/blackbox/test_status.py
All changes applied successfully.
Updated to revision 5444 of branch /home/rory/repos/bzr/bzr.dev
rory@rory-laptop:~/hack/bzr/bzr.dev$ ./bzr st -r1..2
modified:
  bzrlib/__init__.py
bzr: ERROR: exceptions.AttributeError: 'RevisionTree' object has no attribute 'get_shelf_manager'

Traceback (most recent call last):
  File "/home/rory/hack/bzr/bzr.dev/bzrlib/commands.py", line 912, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/home/rory/hack/bzr/bzr.dev/bzrlib/commands.py", line 1112, in run_bzr
    ret = run(*run_argv)
  File "/home/rory/hack/bzr/bzr.dev/bzrlib/commands.py", line 690, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/home/rory/hack/bzr/bzr.dev/bzrlib/commands.py", line 705, in run
    return self._operation.run_simple(*args, **kwargs)
  File "/home/rory/hack/bzr/bzr.dev/bzrlib/cleanup.py", line 135, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "/home/rory/hack/bzr/bzr.dev/bzrlib/cleanup.py", line 165, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/home/rory/hack/bzr/bzr.dev/bzrlib/commands.py", line 1127, in ignore_pipe
    result = func(*args, **kwargs)
  File "/home/rory/hack/bzr/bzr.dev/bzrlib/builtins.py", line 295, in run
    show_pending=(not no_pending), verbose=verbose)
  File "/home/rory/hack/bzr/bzr.dev/bzrlib/status.py", line 220, in show_tree_status
    show_ids, short, verbose))
  File "/home/rory/hack/bzr/bzr.dev/bzrlib/status.py", line 447, in _show_shelve_summary
    manager = params.new_tree.get_shelf_manager()
AttributeError: 'RevisionTree' object has no attribute 'get_shelf_manager'

Related branches

Revision history for this message
Matthew Fuller (fullermd) wrote :

I can reproduce it. I'd call it pretty important, though I'd guess it's also pretty shallow.

Changed in bzr:
importance: Undecided → High
status: New → Confirmed
Revision history for this message
John A Meinel (jameinel) wrote :

The issue is that the new code is enabled-by-default at runtime, but disabled-by-default by the test suite. (It is added at a hook point, but the test suite clears hooks.)

Otherwise we would have had at least 4 failing tests highlight this bug.

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

Definitely needs to be fixed asap. 'status' can deal with revision trees which have no shelf manager so checking either the tree class or the presence of the method would enough (or implement a dummy one for revision tree but this sounds useless at this point and I don't think we'll ever add shelves to revisions).

As to why no tests failed, well, either some are missing (doubtless) or the hook is disabled during tests.

So, as fullermd said: pretty shallow.

I'm setting the milestone to make sure we don't release 2.2b3 without a fix, I'll do that tomorrow if nobody beats me to it.

Changed in bzr:
importance: High → Critical
milestone: none → 2.3b3
summary: - "bzr status -r1..2" crashes from r5444
+ status should can't find a shelf manager on a revision tree
summary: - status should can't find a shelf manager on a revision tree
+ status can't find a shelf manager on a revision tree
Vincent Ladeuil (vila)
Changed in bzr:
assignee: nobody → jamcool (jam)
status: Confirmed → Fix Released
assignee: jamcool (jam) → John A Meinel (jameinel)
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.