def precommit_hook(repo, **kwargs):
    commitctx = repo.commitctx

def updatectx(ctx, error):
    ctx._text += ' ... additional text'
return commitctx(ctx, error)
repo.commitctx = updatectx
Mercurial Hook - change a commit message pre commit