From 7057ce2c2b861e66d67d37ebbddb2ab0ac849d5e Mon Sep 17 00:00:00 2001 From: Frej Drejhammar Date: Wed, 30 Sep 2020 17:42:31 +0200 Subject: [PATCH] Allow plugins to modify the committer Plugins have since they were introduced been able to modify the author of a commit, but not the committer. This patch adds the necessary support for allowing them to also modify the committer. --- README.md | 2 +- hg-fast-export.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 11720b4..e411cd5 100644 --- a/README.md +++ b/README.md @@ -167,7 +167,7 @@ defined filter methods in the [dos2unix](./plugins/dos2unix) and [branch_name_in_commit](./plugins/branch_name_in_commit) plugins. ``` -commit_data = {'branch': branch, 'parents': parents, 'author': author, 'desc': desc, 'revision': revision, 'hg_hash': hg_hash} +commit_data = {'branch': branch, 'parents': parents, 'author': author, 'desc': desc, 'revision': revision, 'hg_hash': hg_hash, 'committer': 'committer'} def commit_message_filter(self,commit_data): ``` diff --git a/hg-fast-export.py b/hg-fast-export.py index 4627eb1..7c22d81 100755 --- a/hg-fast-export.py +++ b/hg-fast-export.py @@ -305,12 +305,16 @@ def export_commit(ui,repo,revision,old_marks,max,count,authors, hg_hash=revsymbol(repo,b"%d" % revision).hex() if plugins and plugins['commit_message_filters']: - commit_data = {'branch': branch, 'parents': parents, 'author': author, 'desc': desc, 'revision': revision, 'hg_hash': hg_hash} + commit_data = {'branch': branch, 'parents': parents, + 'author': author, 'desc': desc, + 'revision': revision, 'hg_hash': hg_hash, + 'committer': user} for filter in plugins['commit_message_filters']: filter(commit_data) branch = commit_data['branch'] parents = commit_data['parents'] author = commit_data['author'] + user = commit_data['committer'] desc = commit_data['desc'] if len(parents)==0 and revision != 0: