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
=== modified file 'bzrlib/option.py'
--- bzrlib/option.py 2010-05-05 04:08:11 +0000
+++ bzrlib/option.py 2010-05-24 04:29:26 +0000
@@ -506,9 +506,6 @@
506# Declare the standard options506# Declare the standard options
507_standard_option('help', short_name='h',507_standard_option('help', short_name='h',
508 help='Show help message.')508 help='Show help message.')
509_standard_option('null', short_name='0',
510 help='Use an ASCII NUL (\\0) separator rather than '
511 'a newline.')
512_standard_option('usage',509_standard_option('usage',
513 help='Show usage message and options.')510 help='Show usage message and options.')
514_standard_option('verbose', short_name='v',511_standard_option('verbose', short_name='v',
@@ -533,6 +530,9 @@
533 short_name='m',530 short_name='m',
534 help='Message string.')531 help='Message string.')
535_global_option('no-recurse')532_global_option('no-recurse')
533_global_option('null', short_name='0',
534 help='Use an ASCII NUL (\\0) separator rather than '
535 'a newline.')
536_global_option('profile',536_global_option('profile',
537 help='Show performance profiling information.')537 help='Show performance profiling information.')
538_global_option('revision',538_global_option('revision',
539539
=== modified file 'bzrlib/tests/test_help.py'
--- bzrlib/tests/test_help.py 2010-05-24 02:08:02 +0000
+++ bzrlib/tests/test_help.py 2010-05-24 04:29:26 +0000
@@ -128,7 +128,6 @@
128 '\n'128 '\n'
129 'Options:\n'129 'Options:\n'
130 ' --usage Show usage message and options.\n'130 ' --usage Show usage message and options.\n'
131 ' -0, --null Use an ASCII NUL (\\0) separator rather than a newline.\n'
132 ' -v, --verbose Display more information.\n'131 ' -v, --verbose Display more information.\n'
133 ' -q, --quiet Only display errors and warnings.\n'132 ' -q, --quiet Only display errors and warnings.\n'
134 ' -h, --help Show help message.\n'133 ' -h, --help Show help message.\n'
@@ -153,7 +152,6 @@
153 '\n'152 '\n'
154 ':Options:\n'153 ':Options:\n'
155 ' --usage Show usage message and options.\n'154 ' --usage Show usage message and options.\n'
156 ' -0, --null Use an ASCII NUL (\\0) separator rather than a newline.\n'
157 ' -v, --verbose Display more information.\n'155 ' -v, --verbose Display more information.\n'
158 ' -q, --quiet Only display errors and warnings.\n'156 ' -q, --quiet Only display errors and warnings.\n'
159 ' -h, --help Show help message.\n'157 ' -h, --help Show help message.\n'
@@ -195,7 +193,6 @@
195 '\n'193 '\n'
196 'Options:\n'194 'Options:\n'
197 ' --usage Show usage message and options.\n'195 ' --usage Show usage message and options.\n'
198 ' -0, --null Use an ASCII NUL (\\0) separator rather than a newline.\n'
199 ' -v, --verbose Display more information.\n'196 ' -v, --verbose Display more information.\n'
200 ' -q, --quiet Only display errors and warnings.\n'197 ' -q, --quiet Only display errors and warnings.\n'
201 ' -h, --help Show help message.\n'198 ' -h, --help Show help message.\n'
@@ -215,7 +212,6 @@
215 '\n'212 '\n'
216 'Options:\n'213 'Options:\n'
217 ' --usage Show usage message and options.\n'214 ' --usage Show usage message and options.\n'
218 ' -0, --null Use an ASCII NUL (\\0) separator rather than a newline.\n'
219 ' -v, --verbose Display more information.\n'215 ' -v, --verbose Display more information.\n'
220 ' -q, --quiet Only display errors and warnings.\n'216 ' -q, --quiet Only display errors and warnings.\n'
221 ' -h, --help Show help message.\n'217 ' -h, --help Show help message.\n'
@@ -250,7 +246,6 @@
250 '\n'246 '\n'
251 'Options:\n'247 'Options:\n'
252 ' --usage Show usage message and options.\n'248 ' --usage Show usage message and options.\n'
253 ' -0, --null Use an ASCII NUL (\\0) separator rather than a newline.\n'
254 ' -v, --verbose Display more information.\n'249 ' -v, --verbose Display more information.\n'
255 ' -q, --quiet Only display errors and warnings.\n'250 ' -q, --quiet Only display errors and warnings.\n'
256 ' -h, --help Show help message.\n'251 ' -h, --help Show help message.\n'
@@ -294,7 +289,6 @@
294 '\n'289 '\n'
295 'Options:\n'290 'Options:\n'
296 ' --usage Show usage message and options.\n'291 ' --usage Show usage message and options.\n'
297 ' -0, --null Use an ASCII NUL (\\0) separator rather than a newline.\n'
298 ' -v, --verbose Display more information.\n'292 ' -v, --verbose Display more information.\n'
299 ' -q, --quiet Only display errors and warnings.\n'293 ' -q, --quiet Only display errors and warnings.\n'
300 ' -h, --help Show help message.\n'294 ' -h, --help Show help message.\n'