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
changes/01/332501/1
wychen@chromium.org 10 years ago
parent 85cab635b1
commit 5b3bebb18e

@ -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)'],), ''),
]

Loading…
Cancel
Save