Mercurial external precommit hook: get changed files list
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
精彩评论