The Mercurial hook checks that jira key exist in commit message.
If no jira key provided, hook fails and commit transaction rollback.
Available JIRA projects set in the list JIRA_PROJECTS
- Copy
jirakeycheck.py
to ~/.hg (or any dir you like) - Add the following lines to $HOME/.hgrc
[hooks] #check all outgoing commits pretxncommit.jirakeycheck = python:~/.hg/jirakeycheck.py:checkCommitMessage#Check all incoming commits when you pull. Good for pull requests control pretxnchangegroup.jirakeycheckall = python:~/.hg/jirakeycheck.py:checkAllCommitMessage