Merge lp:~bialix/bzr/status-with-shelves into lp:bzr/2.3

Proposed by Alexander Belchenko
Status: Merged
Approved by: John A Meinel
Approved revision: no longer in the source branch.
Merged at revision: 5615
Proposed branch: lp:~bialix/bzr/status-with-shelves
Merge into: lp:bzr/2.3
Diff against target: 41 lines (+18/-3)
2 files modified
bzrlib/status.py (+8/-2)
bzrlib/tests/blackbox/test_status.py (+10/-1)
To merge this branch: bzr merge lp:~bialix/bzr/status-with-shelves
Reviewer Review Type Date Requested Status
John A Meinel Needs Fixing
Review via email: mp+48023@code.launchpad.net

Commit message

Use proper plural form to print status message about existing shelves.

Description of the change

I like new status messages about existing shelves in the working tree. This patch tries to improve singular/plural support for English message. Bazaar don't have i18n support yet, so I don't try to implement the full support for every possible language. Actually this case is perfectly handled by Python gettext library.

To post a comment you must log in.
Revision history for this message
Alexander Belchenko (bialix) wrote :

I will be happy to see it merged into bzr 2.3.1

Revision history for this message
John A Meinel (jameinel) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 1/31/2011 11:07 AM, Alexander Belchenko wrote:
> Alexander Belchenko has proposed merging lp:~bialix/bzr/status-with-shelves into lp:bzr/2.3.
>
> Requested reviews:
> bzr-core (bzr-core)
>
> For more details, see:
> https://code.launchpad.net/~bialix/bzr/status-with-shelves/+merge/48023
>
> I like new status messages about existing shelves in the working tree. This patch tries to improve singular/plural support for English message. Bazaar don't have i18n support yet, so I don't try to implement the full support for every possible language. Actually this case is perfectly handled by Python gettext library.

1 shelf exists
2 shelves exist.

Otherwise I'm fine with including this into the 2.3 branch.

John
=:->

 review: needs_fixing
 merge: approve
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk1G98QACgkQJdeBCYSNAAPMoQCgubPw6OMhVrog43BOXvkTWtzy
YnAAoKmkckZk8uLmSIxCuk0mFFqVPXNX
=nF0h
-----END PGP SIGNATURE-----

review: Needs Fixing
Revision history for this message
Alexander Belchenko (bialix) wrote :

oops, sorry. I will fix the singular part.

Revision history for this message
Alexander Belchenko (bialix) wrote :

I've fixed singular.

Revision history for this message
Andrew Bennetts (spiv) wrote :

sent to pqm by email

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bzrlib/status.py'
2--- bzrlib/status.py 2010-10-18 21:34:05 +0000
3+++ bzrlib/status.py 2011-01-31 22:14:10 +0000
4@@ -450,8 +450,14 @@
5 manager = get_shelf_manager()
6 shelves = manager.active_shelves()
7 if shelves:
8- params.to_file.write('%d shelves exist. '
9- 'See "bzr shelve --list" for details.\n' % len(shelves))
10+ singular = '%d shelf exists. '
11+ plural = '%d shelves exist. '
12+ if len(shelves) == 1:
13+ fmt = singular
14+ else:
15+ fmt = plural
16+ params.to_file.write(fmt % len(shelves))
17+ params.to_file.write('See "bzr shelve --list" for details.\n')
18
19
20 hooks = StatusHooks()
21
22=== modified file 'bzrlib/tests/blackbox/test_status.py'
23--- bzrlib/tests/blackbox/test_status.py 2010-10-29 17:26:03 +0000
24+++ bzrlib/tests/blackbox/test_status.py 2011-01-31 22:14:10 +0000
25@@ -562,7 +562,16 @@
26 self.assertStatus([
27 'added:\n',
28 ' bye.c\n',
29- '1 shelves exist. See "bzr shelve --list" for details.\n',
30+ '1 shelf exists. See "bzr shelve --list" for details.\n',
31+ ],
32+ wt)
33+ self.run_bzr(['shelve', '--all', '-m', 'bar'])
34+ self.build_tree(['spam.c'])
35+ wt.add('spam.c')
36+ self.assertStatus([
37+ 'added:\n',
38+ ' spam.c\n',
39+ '2 shelves exist. See "bzr shelve --list" for details.\n',
40 ],
41 wt)
42

Subscribers

People subscribed via source and target branches