Rev 5509: (vila) Don't require 'get_shelf_manager' to exist on Tree objects inside the in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Tue Oct 19 08:28:24 BST 2010


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 5509 [merge]
revision-id: pqm at pqm.ubuntu.com-20101019072823-2ysxmj0dcdpk3wgx
parent: pqm at pqm.ubuntu.com-20101018170637-r2ta5hd72o4ficv4
parent: john at arbash-meinel.com-20101018213405-qn3biq5yu4i0axut
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Tue 2010-10-19 08:28:23 +0100
message:
  (vila) Don't require 'get_shelf_manager' to exist on Tree objects inside the
   status code. (John A Meinel)
modified:
  bzrlib/status.py               status.py-20050505062338-431bfa63ec9b19e6
  bzrlib/tests/blackbox/test_status.py teststatus.py-20050712014354-508855eb9f29f7dc
  doc/en/release-notes/bzr-2.3.txt NEWS-20050323055033-4e00b5db738777ff
=== modified file 'bzrlib/status.py'
--- a/bzrlib/status.py	2010-09-17 15:15:34 +0000
+++ b/bzrlib/status.py	2010-10-18 21:34:05 +0000
@@ -444,7 +444,10 @@
 
     :param params: StatusHookParams.
     """
-    manager = params.new_tree.get_shelf_manager()
+    get_shelf_manager = getattr(params.new_tree, 'get_shelf_manager', None)
+    if get_shelf_manager is None:
+        return
+    manager = get_shelf_manager()
     shelves = manager.active_shelves()
     if shelves:
         params.to_file.write('%d shelves exist. '

=== modified file 'bzrlib/tests/blackbox/test_status.py'
--- a/bzrlib/tests/blackbox/test_status.py	2010-09-12 05:09:24 +0000
+++ b/bzrlib/tests/blackbox/test_status.py	2010-10-18 21:34:05 +0000
@@ -45,6 +45,14 @@
 
 class BranchStatus(TestCaseWithTransport):
 
+    def setUp(self):
+        super(BranchStatus, self).setUp()
+        # As TestCase.setUp clears all hooks, we install this default
+        # post_status hook handler for the test.
+        status.hooks.install_named_hook('post_status',
+            status._show_shelve_summary,
+            'bzr status')
+
     def assertStatus(self, expected_lines, working_tree,
         revision=None, short=False, pending=True, verbose=False):
         """Run status in working_tree and look for output.
@@ -530,11 +538,6 @@
         self.run_bzr(['shelve', '--all', '-m', 'foo'])
         self.build_tree(['bye.c'])
         wt.add('bye.c')
-        # As TestCase.setUp clears all hooks, we install this default
-        # post_status hook handler for the test.
-        status.hooks.install_named_hook('post_status',
-            status._show_shelve_summary,
-            'bzr status')
         self.assertStatus([
                 'added:\n',
                 '  bye.c\n',

=== modified file 'doc/en/release-notes/bzr-2.3.txt'
--- a/doc/en/release-notes/bzr-2.3.txt	2010-10-18 12:36:03 +0000
+++ b/doc/en/release-notes/bzr-2.3.txt	2010-10-18 21:34:05 +0000
@@ -46,6 +46,9 @@
 
 * Always set PATH in start_bzr.bat on Windows. (Matthäus G. Chajdas, #470264)
 
+* ``bzr status -r X..Y`` was failing because RevisionTree didn't implement
+  ``get_shelf_manager``. (John Arbash Meinel, #662053)
+
 * Don't force openssh to use protocol=2, since that is now the default.
   (Neil Martinsen-Burrell, #561061)
 




More information about the bazaar-commits mailing list