Post-processing a commit message

Eric Eric.Dangoor at
Thu May 21 12:13:56 BST 2009


I need to post-process all commit messages, after they have been entered but 
before the commit actually happens. I have written a pre_commit hook which 
gets hold of the entered message and carries out the post-processing. I now 
want to replace the original message with the modified one.

I tried:

branch.repository.get_revision(future_revid).message = formatted_comment

where formatted_comment is my new message, but this doesn't modify the message.

Is it possible to do what I want ? I have seen that there are warnings not to 
modify the tree_delta and future_tree in the pre_commit hook. Does this 
include the message ?

Is there another way to achieve what I want ?

Appologies but I am completely new to Python !


More information about the bazaar mailing list