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

Unified Diff: git_cl.py

Issue 1922133006: git_cl: Add the ability to set the description. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: nits for tests. 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 bf949133c959efd8552fd8fe1752b34f55a88aaf..b0c42f4aacd474ad3c9ee29bffc352bde5fe597f 100755
--- a/git_cl.py
+++ b/git_cl.py
@@ -3279,6 +3279,8 @@ 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('-n', '--new-description',
+ help='New description to set for this issue (- for stdin)')
_add_codereview_select_options(parser)
auth.add_auth_options(parser)
@@ -3302,10 +3304,20 @@ def CMDdescription(parser, args):
if not cl.GetIssue():
DieWithError('This branch has no associated changelist.')
description = ChangeDescription(cl.GetDescription())
+
if options.display:
print description.description
return 0
- description.prompt()
+
+ if options.new_description:
+ text = options.new_description
+ if text == '-':
+ text = '\n'.join(sys.stdin.splitlines())
+
+ description.set_description(text)
+ else:
+ description.prompt()
+
if cl.GetDescription() != description.description:
cl.UpdateDescription(description.description)
return 0
« 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