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

Unified Diff: git_cl.py

Issue 10540035: Add git cl comments to read rietveld comments without having to use the rietveld UI (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: The messages list may be out of order so we need to reorder it Created 8 years, 6 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 d2f4b31f3fa320bac98c347d7bc67c32d7e3af18..fa6e084b9280b08ba75ac25a992607d8d00136b5 100755
--- a/git_cl.py
+++ b/git_cl.py
@@ -868,6 +868,22 @@ def CMDissue(parser, args):
return 0
+def CMDcomments(parser, args):
+ """show review comments of the current changelist"""
+ (_, args) = parser.parse_args(args)
+ if args:
+ parser.error('Unsupported argument: %s' % args)
+
+ cl = Changelist()
+ if cl.GetIssue():
+ data = cl.RpcServer().get_issue_properties(cl.GetIssue(), True)
+ for message in sorted(data['messages'], key=lambda x: x['date']):
+ print '\n%s %s' % (message['date'].split('.', 1)[0], message['sender'])
+ if message['text'].strip():
+ print '\n'.join(' ' + l for l in message['text'].splitlines())
+ return 0
+
+
def CreateDescriptionFromLog(args):
"""Pulls out the commit log to use as a base for the CL description."""
log_args = []
@@ -1082,7 +1098,7 @@ def CMDupload(parser, args):
'\nWARNING: Use -t or --title to set the title of the patchset.\n'
'In the near future, -m or --message will send a message instead.\n'
'See http://goo.gl/JGg0Z for details.\n')
-
+
# Make sure index is up-to-date before running diff-index.
RunGit(['update-index', '--refresh', '-q'], error_ok=True)
if RunGit(['diff-index', 'HEAD']):
« 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