Rev 5615: (spiv) Use proper plural form to print status message about existing in file:///home/pqm/archives/thelove/bzr/2.3/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Tue Feb 1 07:38:45 UTC 2011


At file:///home/pqm/archives/thelove/bzr/2.3/

------------------------------------------------------------
revno: 5615 [merge]
revision-id: pqm at pqm.ubuntu.com-20110201073843-0chv714dkh1m1pv0
parent: pqm at pqm.ubuntu.com-20110127151600-ha7nrg4i1kj4b9c0
parent: bialix at ukr.net-20110131220946-hjrabl6hneithjkw
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: 2.3
timestamp: Tue 2011-02-01 07:38:43 +0000
message:
  (spiv) Use proper plural form to print status message about existing
   shelves. (Alexander Belchenko)
modified:
  bzrlib/status.py               status.py-20050505062338-431bfa63ec9b19e6
  bzrlib/tests/blackbox/test_status.py teststatus.py-20050712014354-508855eb9f29f7dc
=== modified file 'bzrlib/status.py'
--- a/bzrlib/status.py	2010-10-18 21:34:05 +0000
+++ b/bzrlib/status.py	2011-01-31 22:09:46 +0000
@@ -450,8 +450,14 @@
     manager = get_shelf_manager()
     shelves = manager.active_shelves()
     if shelves:
-        params.to_file.write('%d shelves exist. '
-            'See "bzr shelve --list" for details.\n' % len(shelves))
+        singular = '%d shelf exists. '
+        plural = '%d shelves exist. '
+        if len(shelves) == 1:
+            fmt = singular
+        else:
+            fmt = plural
+        params.to_file.write(fmt % len(shelves))
+        params.to_file.write('See "bzr shelve --list" for details.\n')
 
 
 hooks = StatusHooks()

=== modified file 'bzrlib/tests/blackbox/test_status.py'
--- a/bzrlib/tests/blackbox/test_status.py	2010-10-29 17:26:03 +0000
+++ b/bzrlib/tests/blackbox/test_status.py	2011-01-31 22:09:46 +0000
@@ -562,7 +562,16 @@
         self.assertStatus([
                 'added:\n',
                 '  bye.c\n',
-                '1 shelves exist. See "bzr shelve --list" for details.\n',
+                '1 shelf exists. See "bzr shelve --list" for details.\n',
+            ],
+            wt)
+        self.run_bzr(['shelve', '--all', '-m', 'bar'])
+        self.build_tree(['spam.c'])
+        wt.add('spam.c')
+        self.assertStatus([
+                'added:\n',
+                '  spam.c\n',
+                '2 shelves exist. See "bzr shelve --list" for details.\n',
             ],
             wt)
 




More information about the bazaar-commits mailing list