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

Unified Diff: gcl.py

Issue 12047089: Make gcl commit/git cl dcommit append a commit notification to rietveld. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Pull AddComment from git_cl.py Created 7 years, 11 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 | git_cl.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gcl.py
diff --git a/gcl.py b/gcl.py
index 4cc6fcac74d83de155038403be3c2d94d0002537..de9e49ca35ba0f80d22a446765aae083c742e614 100755
--- a/gcl.py
+++ b/gcl.py
@@ -393,6 +393,11 @@ class ChangeInfo(object):
"""Returns the issue description from Rietveld."""
return self.SendToRietveld('/%d/description' % self.issue)
+ def AddComment(self, comment):
+ """Adds a comment for an issue on Rietveld.
+ As a side effect, this will email everyone associated with the issue."""
+ return self.RpcServer().add_comment(self.issue, comment)
+
def PrimeLint(self):
"""Do background work on Rietveld to lint the file so that the results are
ready when the issue is viewed."""
@@ -982,6 +987,8 @@ def CMDcommit(change_info, args):
print "Nothing to commit, changelist is empty."
return 1
+ # OptionallyDoPresubmitChecks has a side-effect which eats these flags.
+ bypassed = '--no_presubmit' in args or '--force' in args
output = OptionallyDoPresubmitChecks(change_info, True, args)
if not output.should_continue():
return 1
@@ -1038,6 +1045,9 @@ def CMDcommit(change_info, args):
elif revision:
change_info.description += "\nCommitted: " + revision
change_info.CloseIssue()
+ comment = "Committed manually as r%s" % revision
+ comment += ' (presubmit successful).' if not bypassed else '.'
+ change_info.AddComment(comment)
return 0
« no previous file with comments | « no previous file | git_cl.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698