Merge lp:~parthm/bzr/non-standard-null-option into lp:bzr

Proposed by Parth Malwankar
Status: Merged
Approved by: Robert Collins
Approved revision: no longer in the source branch.
Merged at revision: 5254
Proposed branch: lp:~parthm/bzr/non-standard-null-option
Merge into: lp:bzr
Diff against target: 75 lines (+3/-9)
2 files modified
bzrlib/option.py (+3/-3)
bzrlib/tests/test_help.py (+0/-6)
To merge this branch: bzr merge lp:~parthm/bzr/non-standard-null-option
Reviewer Review Type Date Requested Status
Martin Pool Approve
Robert Collins (community) Approve
Review via email: mp+25851@code.launchpad.net

Commit message

Fix the type of the recently introduced null option - it should have been global, not standard.

Description of the change

Due to an unfortunate error in the fix[1] for bug #181124 the --null/-0 option ended up as a _standard_option rather than a _global_option due to which it shows up as a valid option for commands like version and branch. This mp is a trivial fix for this.

[1] https://code.launchpad.net/~parthm/bzr/181124-ls-short-opts/+merge/24414

To post a comment you must log in.
Revision history for this message
Robert Collins (lifeless) wrote :

Its a bit redundant to say this as well as clicking approved, but +1

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

i too would have thought standard_option and global_option had the opposite meaning of what they apparently do.

review: Approve
Revision history for this message
Robert Collins (lifeless) wrote :

sent to pqm by email

Revision history for this message
Robert Collins (lifeless) wrote :

This failed on PQM but the reason is unclear (and not just PQM being
very verbose :- querying losas to see if I can ascertain a cause).

-Rob

Revision history for this message
Parth Malwankar (parthm) wrote :

> This failed on PQM but the reason is unclear (and not just PQM being
> very verbose :- querying losas to see if I can ascertain a cause).
>
> -Rob

Sorry about that. I see some bt.test_help failures. I will fix
it and try to land it.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bzrlib/option.py'
2--- bzrlib/option.py 2010-05-05 04:08:11 +0000
3+++ bzrlib/option.py 2010-05-24 04:29:26 +0000
4@@ -506,9 +506,6 @@
5 # Declare the standard options
6 _standard_option('help', short_name='h',
7 help='Show help message.')
8-_standard_option('null', short_name='0',
9- help='Use an ASCII NUL (\\0) separator rather than '
10- 'a newline.')
11 _standard_option('usage',
12 help='Show usage message and options.')
13 _standard_option('verbose', short_name='v',
14@@ -533,6 +530,9 @@
15 short_name='m',
16 help='Message string.')
17 _global_option('no-recurse')
18+_global_option('null', short_name='0',
19+ help='Use an ASCII NUL (\\0) separator rather than '
20+ 'a newline.')
21 _global_option('profile',
22 help='Show performance profiling information.')
23 _global_option('revision',
24
25=== modified file 'bzrlib/tests/test_help.py'
26--- bzrlib/tests/test_help.py 2010-05-24 02:08:02 +0000
27+++ bzrlib/tests/test_help.py 2010-05-24 04:29:26 +0000
28@@ -128,7 +128,6 @@
29 '\n'
30 'Options:\n'
31 ' --usage Show usage message and options.\n'
32- ' -0, --null Use an ASCII NUL (\\0) separator rather than a newline.\n'
33 ' -v, --verbose Display more information.\n'
34 ' -q, --quiet Only display errors and warnings.\n'
35 ' -h, --help Show help message.\n'
36@@ -153,7 +152,6 @@
37 '\n'
38 ':Options:\n'
39 ' --usage Show usage message and options.\n'
40- ' -0, --null Use an ASCII NUL (\\0) separator rather than a newline.\n'
41 ' -v, --verbose Display more information.\n'
42 ' -q, --quiet Only display errors and warnings.\n'
43 ' -h, --help Show help message.\n'
44@@ -195,7 +193,6 @@
45 '\n'
46 'Options:\n'
47 ' --usage Show usage message and options.\n'
48- ' -0, --null Use an ASCII NUL (\\0) separator rather than a newline.\n'
49 ' -v, --verbose Display more information.\n'
50 ' -q, --quiet Only display errors and warnings.\n'
51 ' -h, --help Show help message.\n'
52@@ -215,7 +212,6 @@
53 '\n'
54 'Options:\n'
55 ' --usage Show usage message and options.\n'
56- ' -0, --null Use an ASCII NUL (\\0) separator rather than a newline.\n'
57 ' -v, --verbose Display more information.\n'
58 ' -q, --quiet Only display errors and warnings.\n'
59 ' -h, --help Show help message.\n'
60@@ -250,7 +246,6 @@
61 '\n'
62 'Options:\n'
63 ' --usage Show usage message and options.\n'
64- ' -0, --null Use an ASCII NUL (\\0) separator rather than a newline.\n'
65 ' -v, --verbose Display more information.\n'
66 ' -q, --quiet Only display errors and warnings.\n'
67 ' -h, --help Show help message.\n'
68@@ -294,7 +289,6 @@
69 '\n'
70 'Options:\n'
71 ' --usage Show usage message and options.\n'
72- ' -0, --null Use an ASCII NUL (\\0) separator rather than a newline.\n'
73 ' -v, --verbose Display more information.\n'
74 ' -q, --quiet Only display errors and warnings.\n'
75 ' -h, --help Show help message.\n'