开发者

Mercurial external precommit hook: get changed files list

开发者 https://www.devze.com 2023-04-02 20:47 出处:网络
I could get it 开发者_StackOverfloweither with hg status --change $HG_NODE or with hg log -r $HG_NODE --style mycustomstyle

I could get it 开发者_StackOverfloweither with

hg status --change $HG_NODE

or with

hg log -r $HG_NODE --style mycustomstyle

But I can't get HG_NODE in precommit hook. Is there any workaround?


If

hg status --change $HG_NODE

is what you want, I guess you could just use:

hg status


$HG_NODE is not available in precommit since the changeset was not created yet

You may use the pretxncommit instead (Run after a new changeset has been created in the local repository, but before the transaction completes that will make it permanent)

Note that since the changeset is already 'done', modifications made to sources by the hooks will not be applied in the current changeset.

I'm currently trying to update a source file with the current changeset while committing, but I didn't found a solution yet

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号