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

Unified Diff: git_cl.py

Issue 2307463002: git_cl: Enable updating description from local. (Closed)
Patch Set: Use same method as "git cl upload". Created 4 years, 3 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 | no next file » | 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 1f62dc055b2ff25693dce38d836403806e641707..3a5f5e8025bbb2f2521bf0351ac9dbd4f6914ccf 100755
--- a/git_cl.py
+++ b/git_cl.py
@@ -1322,7 +1322,7 @@ class Changelist(object):
self.issue = None
self.patchset = None
- def GetChange(self, upstream_branch, author):
+ def GetChange(self, upstream_branch, author, local_description=False):
if not self.GitSanityChecks(upstream_branch):
DieWithError('\nGit sanity check failure')
@@ -1347,7 +1347,7 @@ class Changelist(object):
issue = self.GetIssue()
patchset = self.GetPatchset()
- if issue:
+ if issue and not local_description:
description = self.GetDescription()
else:
# If the change was never uploaded, use the log messages of all commits
@@ -3581,7 +3581,8 @@ def CMDdescription(parser, args):
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)')
+ help='New description to set for this issue (- for stdin, '
+ '+ to load from local commit HEAD)')
_add_codereview_select_options(parser)
auth.add_auth_options(parser)
@@ -3620,6 +3621,10 @@ def CMDdescription(parser, args):
text = options.new_description
if text == '-':
text = '\n'.join(l.rstrip() for l in sys.stdin)
+ elif text == '+':
+ base_branch = cl.GetCommonAncestorWithUpstream()
+ change = cl.GetChange(base_branch, None, local_description=True)
+ text = change.FullDescriptionText()
description.set_description(text)
else:
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698