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

Unified Diff: git_cl.py

Issue 2466953003: git-cl-land: print url of final commit location (Closed)
Patch Set: Avoid iterating over nonetype Created 4 years, 1 month 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 | « gerrit_util.py ('k') | 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 6b0d304913564e07865e76fdb768534aa41c36df..44bc1dcc85b03938c9abcf81381ff0fd149d0977 100755
--- a/git_cl.py
+++ b/git_cl.py
@@ -2537,6 +2537,14 @@ class _GerritChangelistImpl(_ChangelistCodereviewBase):
raise GerritIssueNotExists(issue, self.GetCodereviewServer())
return data
+ def _GetChangeCommit(self, issue=None):
+ issue = issue or self.GetIssue()
+ assert issue, 'issue is required to query Gerrit'
+ data = gerrit_util.GetChangeCommit(self._GetGerritHost(), str(issue))
+ if not data:
+ raise GerritIssueNotExists(issue, self.GetCodereviewServer())
+ return data
+
def CMDLand(self, force, bypass_hooks, verbose):
if git_common.is_dirty_git_tree('land'):
return 1
@@ -2575,6 +2583,11 @@ class _GerritChangelistImpl(_ChangelistCodereviewBase):
self.SubmitIssue(wait_for_merge=True)
print('Issue %s has been submitted.' % self.GetIssueURL())
+ links = self._GetChangeCommit().get('web_links', [])
+ for link in links:
+ if link.get('name') == 'gerrit' and link.get('url'):
+ print('Landed as %s' % link.get('url'))
+ break
return 0
def CMDPatchWithParsedIssue(self, parsed_issue_arg, reject, nocommit,
« no previous file with comments | « gerrit_util.py ('k') | tests/git_cl_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698