Pass original hg commit hash to plugins

This commit is contained in:
Ondrej Stanek
2020-06-24 13:50:27 +02:00
parent 21827a53f7
commit 9c6dea9fd4
2 changed files with 3 additions and 2 deletions

View File

@@ -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}
commit_data = {'branch': branch, 'parents': parents, 'author': author, 'desc': desc, 'revision': revision, 'hg_hash': hg_hash}
def commit_message_filter(self,commit_data):
```

View File

@@ -302,9 +302,10 @@ def export_commit(ui,repo,revision,old_marks,max,count,authors,
parents = [p for p in repo.changelog.parentrevs(revision) if p >= 0]
author = get_author(desc,user,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}
commit_data = {'branch': branch, 'parents': parents, 'author': author, 'desc': desc, 'revision': revision, 'hg_hash': hg_hash}
for filter in plugins['commit_message_filters']:
filter(commit_data)
branch = commit_data['branch']