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
diff --git a/git_cl.py b/git_cl.py
index f3aa2ab..8cc37bf 100755
--- a/git_cl.py
+++ b/git_cl.py
@@ -2764,7 +2764,8 @@
# 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)
diff --git a/tests/git_cl_test.py b/tests/git_cl_test.py
index bb963c7..54878eb 100755
--- a/tests/git_cl_test.py
+++ b/tests/git_cl_test.py
@@ -878,6 +878,7 @@
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 @@
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)'],), ''),
]