Index: git_cl.py |
diff --git a/git_cl.py b/git_cl.py |
index cf1e2c91093d9d73a21982b9336e1ce757b6a7ed..dd0d716d030d573ec3d4b3e0549d0cec4a5db71c 100755 |
--- a/git_cl.py |
+++ b/git_cl.py |
@@ -3256,10 +3256,42 @@ 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', type=int, |
+ help='The issue to fetch the description from') |
tandrii(chromium)
2016/04/18 22:13:16
s/from/from, instead of the current branch issue.
martiniss
2016/04/19 00:18:53
Changed. And made it so you can copy paste a URL.
|
+ parser.add_option('--gerrit', action='store_true', default=False, |
+ help='The issue is stored in gerrit') |
+ parser.add_option('--rietveld', action='store_true', default=False, |
+ help='The issue is stored in rietveld') |
+ parser.add_option('-s', '--server', |
tandrii(chromium)
2016/04/18 22:13:16
do you actually use this field? If you do, then ma
martiniss
2016/04/19 00:18:53
Removed.
|
+ help='The codereview server the issue is stored at') |
+ |
auth.add_auth_options(parser) |
options, _ = parser.parse_args(args) |
+ |
+ if options.gerrit and options.rietveld: |
tandrii(chromium)
2016/04/18 22:13:16
see _process_codereview_select_options
martiniss
2016/04/19 00:18:53
Done.
|
+ DieWithError('only one of --gerrit and --rietveld is allowed') |
+ if not (options.gerrit or options.rietveld) and ( |
+ options.issue or options.server): |
+ DieWithError('one of --gerrit and --rietveld is required') |
tandrii(chromium)
2016/04/18 22:13:16
why is this so? it wasn't required before. and the
martiniss
2016/04/19 00:18:53
Removed.
|
+ |
+ codereview = None |
+ if options.gerrit: |
+ codereview = 'gerrit' |
+ if options.rietveld: |
+ codereview = 'rietveld' |
+ |
auth_config = auth.extract_auth_config_from_options(options) |
- cl = Changelist(auth_config=auth_config) |
+ kwargs = { |
+ 'auth_config': auth_config, |
+ 'issue': options.issue, |
+ 'codereview': codereview, |
+ } |
+ |
+ if options.rietveld: |
+ kwargs['rietveld_server'] = options.server |
+ # else nothing, because gerrit guesses the code review from the git host, for |
tandrii(chromium)
2016/04/18 22:13:16
so does rietveld, as it's the server is recorded i
martiniss
2016/04/19 00:18:53
Removed.
|
+ # now |
+ cl = Changelist(**kwargs) |
if not cl.GetIssue(): |
DieWithError('This branch has no associated changelist.') |
description = ChangeDescription(cl.GetDescription()) |