mercurialhookmercurial-hook

hg hook -> check merged files


I have a hg hook that checks files that are in commit (pretxncommit type of hook) for coding standards. However if I make a merge all files are excluded from checking. If I make a merge and edit then some of the merged files they are processed by the hook.

Moreover "hg st" shows all the modified files including merged one.

Is there any way to force hg hook to check all the files?

Thanks.


Solution

  • Assuming the hook is written in Python, you define it as something like

    def check_files(ui, repo, **kwargs):
    ...
    

    Then repo.status() returns all files with their respective status. There is TODO to add more details in this place in the documentation :)