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, |