Chromium Code Reviews| Index: git_cl.py |
| diff --git a/git_cl.py b/git_cl.py |
| index cf1e2c91093d9d73a21982b9336e1ce757b6a7ed..aae11076b2d2dbb4a5a214bc84022d7945943eb0 100755 |
| --- a/git_cl.py |
| +++ b/git_cl.py |
| @@ -3252,19 +3252,40 @@ def CMDcomments(parser, args): |
| return 0 |
| +@subcommand.usage('<codereview url or issue id>') |
|
tandrii(chromium)
2016/04/19 09:42:04
wrap in [] to indicate optionality. by default, is
martiniss
2016/04/25 22:33:06
Done.
|
| def CMDdescription(parser, args): |
| """Brings up the editor for the current CL's description.""" |
| parser.add_option('-d', '--display', action='store_true', |
| help='Display the description instead of opening an editor') |
| + parser.add_option('-i', '--issue', |
|
tandrii(chromium)
2016/04/19 09:42:04
this contradicts the help above. IMO, choose eithe
martiniss
2016/04/25 22:33:06
Removed.
|
| + help='The issue to act on the description of') |
| + |
| + _add_codereview_select_options(parser) |
| auth.add_auth_options(parser) |
| - options, _ = parser.parse_args(args) |
| + options, args = parser.parse_args(args) |
| + _process_codereview_select_options(parser, options) |
| + |
| + target_issue = None |
| + if options.issue: |
| + issue_arg = ParseIssueNumberArgument(options.issue) |
| + if not issue_arg.valid: |
| + parser.print_help() |
| + return 1 |
| + target_issue = issue_arg.issue |
|
tandrii(chromium)
2016/04/19 09:42:04
you are potentially disregarding the codereview se
|
| + |
| auth_config = auth.extract_auth_config_from_options(options) |
| - cl = Changelist(auth_config=auth_config) |
| + kwargs = { |
| + 'auth_config': auth_config, |
| + 'issue': target_issue, |
| + 'codereview': options.forced_codereview, |
| + } |
| + |
| + cl = Changelist(**kwargs) |
|
tandrii(chromium)
2016/04/19 09:42:04
you don't need kwargs var any more.
martiniss
2016/04/25 22:33:06
Fixed.
|
| if not cl.GetIssue(): |
| DieWithError('This branch has no associated changelist.') |
| description = ChangeDescription(cl.GetDescription()) |
| if options.display: |
| - print description.description |
| + print >> sys.stdout, description.description |
|
tandrii(chromium)
2016/04/19 09:42:04
debug leftover?
martiniss
2016/04/25 22:33:06
No, you need this to be able to mock it in the tes
|
| return 0 |
| description.prompt() |
| if cl.GetDescription() != description.description: |