diff options
author | Catalin Marinas <catalin.marinas@gmail.com> | 2010-03-22 16:16:35 +0000 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@gmail.com> | 2010-03-22 16:16:35 +0000 |
commit | 1666c983e2260a60f9f6318a03e8cbb1cd320cba (patch) | |
tree | 3f0ea61e26582d1228e6649379da03ec5698f2dc | |
parent | 7d7210c881f52397e421238528d4368c6a51414b (diff) | |
download | stgit-1666c983e2260a60f9f6318a03e8cbb1cd320cba.tar.gz |
pick --revert wasn't using the correct author
The author should be the one reverting the patch rather than the creator
of the reverted commit. The patch also improves the revert message to
contain the description of the reverted commit.
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
-rw-r--r-- | stgit/commands/pick.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/stgit/commands/pick.py b/stgit/commands/pick.py index 8414702..89b0370 100644 --- a/stgit/commands/pick.py +++ b/stgit/commands/pick.py @@ -109,15 +109,20 @@ def __pick_commit(commit_id, patchname, options): message = commit.get_log() if options.revert: if message: - subject = message.splitlines()[0] + lines = message.splitlines() + subject = lines[0] + body = '\n'.join(lines[2:]) else: subject = commit.get_id_hash() - message = 'Revert "%s"\n\nThis reverts commit %s.\n' \ - % (subject, commit.get_id_hash()) + body = '' + message = 'Revert "%s"\n\nThis reverts commit %s.\n\n%s\n' \ + % (subject, commit.get_id_hash(), body) elif options.expose: message += '(imported from commit %s)\n' % commit.get_id_hash() author_name, author_email, author_date = \ name_email_date(commit.get_author()) + if options.revert: + author_name = author_email = None out.start('Importing commit %s' % commit_id) |