Get list of change sets in changegroup (mercury python)

I want the Mercurial hook to run JSLint / PyChecker / etc for all files that have been modified. However, I do not control all hg clients and want this to be done when I click on the main repository (which I have control), so it’s best to use the pretxnchangegroup hook on the main server.

How can I get a list of all the change sets that are in the change group that will be executed?

I have other solutions that use the precommit hook, but they will not work for me, because clients may already have a commit that does not work JSLint. In this case, they should be able to correct errors in the new commit and be able to successfully click (both bad and new) on the server. The server just needs to check the most recent set of changes in each branch, each file that has been changed in the change group.

+3
source share
3 answers

, pretxnchangegroup, - , , , !

hg status --rev x:y, , , , , .

, revset (hg help revsets) new 1.6, , , .

+4

pretxnchangegroup, . , , , :

hg status --rev $HG_NODE:

( -)

hg status --change $HG_NODE

, , change, .

http://www.selenic.com/mercurial/hgrc.5.html, $HG_NODE.

+3

? fooobar.com/questions/1762729/...

pretxnchangegroup, change

0

Source: https://habr.com/ru/post/1762727/


All Articles