Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(38)

Unified Diff: git_cl.py

Issue 1901733003: git_cl: description fetching from code review servers. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Small whitespace. Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests/git_cl_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: git_cl.py
diff --git a/git_cl.py b/git_cl.py
index d7c963674ed3750aa087f077d3f2ca9bb6b51da3..7d3c1055c23e0fa986b34cfca09003c41a939b19 100755
--- a/git_cl.py
+++ b/git_cl.py
@@ -3264,19 +3264,36 @@ def CMDcomments(parser, args):
return 0
+@subcommand.usage('[codereview url or issue id]')
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')
+
+ _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 len(args) > 0:
+ issue_arg = ParseIssueNumberArgument(args[0])
+ if not issue_arg.valid:
+ parser.print_help()
+ return 1
+ target_issue = issue_arg.issue
+
auth_config = auth.extract_auth_config_from_options(options)
- cl = Changelist(auth_config=auth_config)
+
+ cl = Changelist(
+ auth_config=auth_config, issue=target_issue,
+ codereview=options.forced_codereview)
+
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
return 0
description.prompt()
if cl.GetDescription() != description.description:
« no previous file with comments | « no previous file | tests/git_cl_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698