Commit 5b3bebb1 authored by wychen@chromium.org's avatar wychen@chromium.org

In PatchIssue, add CL description to commit message

Before this change, the commit message only contains issue number and
patchset number. Adding CL description should be more informative.

Review URL: https://codereview.chromium.org/1128473003

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@295449 0039d316-1c4b-4281-b951-d872f2087c98
parent 85cab635
......@@ -2764,7 +2764,8 @@ def PatchIssue(issue_arg, reject, nocommit, directory, auth_config):
# If we had an issue, commit the current state and register the issue.
if not nocommit:
RunGit(['commit', '-m', ('patch from issue %(i)s at patchset '
RunGit(['commit', '-m', (cl.GetDescription() + '\n\n' +
'patch from issue %(i)s at patchset '
'%(p)s (http://crrev.com/%(i)s#ps%(p)s)'
% {'i': issue, 'p': patchset})])
cl = Changelist(auth_config=auth_config)
......
......@@ -878,6 +878,7 @@ class TestGitCl(TestCase):
def _patch_common(self):
self.mock(git_cl.Changelist, 'GetMostRecentPatchset', lambda x: '60001')
self.mock(git_cl.Changelist, 'GetPatchSetDiff', lambda *args: None)
self.mock(git_cl.Changelist, 'GetDescription', lambda *args: 'Description')
self.mock(git_cl.Changelist, 'SetIssue', lambda *args: None)
self.mock(git_cl.Changelist, 'SetPatchset', lambda *args: None)
self.mock(git_cl, 'IsGitVersionAtLeast', lambda *args: True)
......@@ -894,6 +895,7 @@ class TestGitCl(TestCase):
self.calls += [
((['git', 'apply', '--index', '-p0', '--3way'],), ''),
((['git', 'commit', '-m',
'Description\n\n' +
'patch from issue 123456 at patchset 60001 ' +
'(http://crrev.com/123456#ps60001)'],), ''),
]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment