6

The title says it: I am looking for the variable names (HG_*) so I can make use of them in my hook script..

StayOnTarget
  • 11,743
  • 10
  • 52
  • 81
Bonefisher
  • 509
  • 1
  • 5
  • 15

2 Answers2

9

Oben has your best answer, but for specific cases or poorly documented options you can easily test specific hooks using a hook that just prints variables:

hg --config hooks.pre-commit="export| grep HG_" commit

Where pre-commit can be any hook you want to test and commit can be any command you want to test.

For example that one showed:

export HG_ARGS='commit'
export HG_OPTS='{'"'"'exclude'"'"': [], '"'"'message'"'"': '"''"', '"'"'addremove'"'"': None, '"'"'include'"'"': [], '"'"'close_branch'"'"': None, '"'"'user'"'"': '"''"', '"'"'date'"'"': '"''"', '"'"'logfile'"'"': '"''"', '"'"'mq'"'"': None}'
export HG_PATS='[]'
Ry4an Brase
  • 78,112
  • 7
  • 148
  • 169
8

The hooks section in the hgrc manpage lists all defined hooks, including the environment variables available for each hook.

Oben Sonne
  • 9,893
  • 2
  • 40
  • 61