git-cl-land: print url of final commit location
BUG=661187
Review-Url: https://codereview.chromium.org/2466953003
diff --git a/gerrit_util.py b/gerrit_util.py
index 7cab2a5..50b00e8 100755
--- a/gerrit_util.py
+++ b/gerrit_util.py
@@ -483,6 +483,12 @@
return ReadHttpJsonResponse(CreateHttpConn(host, path))
+def GetChangeCommit(host, change, revision='current'):
+ """Query a gerrit server for a revision associated with a change."""
+ path = 'changes/%s/revisions/%s/commit?links' % (change, revision)
+ return ReadHttpJsonResponse(CreateHttpConn(host, path))
+
+
def GetChangeDescriptionFromGitiles(url, revision):
"""Query Gitiles for actual commit message for a given url and ref.