utapyngo
utapyngo

Reputation: 7146

Mercurial external precommit hook: get changed files list

I could get it either 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?

Upvotes: 1

Views: 661

Answers (2)

Nore
Nore

Reputation: 93

$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

Upvotes: 0

Ringding
Ringding

Reputation: 2856

If

hg status --change $HG_NODE

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

hg status

Upvotes: 2

Related Questions