We are using pretxncommit
hook for HG to run a quick static analysis check on code commited. However the hook is triggered on applying any changes to commit tree - which includes rebasing and using MQ to edit and squash commits.
Is it possible to somehow check what type of change is happening in hook itself? Like
def analyze_hook(ui, repo, node=None, **kwargs):
if repo.state.is_commit_added and not (repo.state.is_rebase or repo.state.is_patch):
return 0