From 52d224a24efd38b2c322964343e77f52841c1f42 Mon Sep 17 00:00:00 2001 From: "rmistry@google.com" Date: Wed, 27 Aug 2014 14:44:41 +0000 Subject: [PATCH] Add the patchset id to the manual commit messages Context is here: https://groups.google.com/a/chromium.org/d/msg/chromium-dev/M7f9VTqrR8w/RECOX2Y5YasJ Review URL: https://codereview.chromium.org/513763002 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@291687 0039d316-1c4b-4281-b951-d872f2087c98 --- gcl.py | 3 ++- git_cl.py | 4 ++-- tests/gcl_unittest.py | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/gcl.py b/gcl.py index b020e74bb9..a32b950fe4 100755 --- a/gcl.py +++ b/gcl.py @@ -1075,7 +1075,8 @@ def CMDcommit(change_info, args): props = change_info.RpcServer().get_issue_properties( change_info.issue, False) patch_num = len(props['patchsets']) - comment = "Committed patchset #%d manually as r%s" % (patch_num, revision) + comment = "Committed patchset #%d (id:%d) manually as r%s" % ( + patch_num, props['patchsets'][-1], revision) if bypassed: comment += ' (tree was closed).' if GetTreeStatus() == 'closed' else '.' else: diff --git a/git_cl.py b/git_cl.py index 063e9c5f1e..8be31201c2 100755 --- a/git_cl.py +++ b/git_cl.py @@ -2053,8 +2053,8 @@ def SendUpstream(parser, args, cmd): cl.CloseIssue() props = cl.GetIssueProperties() patch_num = len(props['patchsets']) - comment = "Committed patchset #%d%s manually as %s" % ( - patch_num, to_pending, revision) + comment = "Committed patchset #%d (id:%d)%s manually as %s" % ( + patch_num, props['patchsets'][-1], to_pending, revision) if options.bypass_hooks: comment += ' (tree was closed).' if GetTreeStatus() == 'closed' else '.' else: diff --git a/tests/gcl_unittest.py b/tests/gcl_unittest.py index 602bafb763..b3787447be 100755 --- a/tests/gcl_unittest.py +++ b/tests/gcl_unittest.py @@ -613,7 +613,8 @@ class CMDCommitUnittest(GclTestsBase): self.assertTrue(change_info._closed) self.assertEqual( change_info._comments_added, - ["Committed patchset #1 manually as r12345 (presubmit successful)."]) + ["Committed patchset #1 (id:1337) manually as r12345 (presubmit " + "successful)."]) if __name__ == '__main__':