How to add hooks for Mercurial MQ commands?
-
27-10-2019 - |
문제
I would like to setup hg hooks for some actions done by mq extension. For example when I do
hg qnew
I would like to use post-review to create a new review request in our reviewboard server. I would also like to make a hook that updates the diff if you do
hg qrefresh
Is this possible?
해결책
All Mercurial commands have both a pre-XXX
and post-XXX
hook. So you can write write hooks like:
[hooks]
post-qnew.reviewboard = post-review $(hg root)/.hg/patches/$(hg qtip)
post-qrefresh.reviewboard = post-review $(hg root)/.hg/patches/$(hg qtip)
or whatever the correct post-review invocation is.
All examples approximate. :)
제휴하지 않습니다 StackOverflow