Question

I've searched awhile for this and haven't seen anything. Which could mean, it's not supposed to be done or it just can't be done.

I looked at a list of hooks for mercurial and I could not seem to find (or get one working) that executed a script after you give the hg pull command.

Thank you

Was it helpful?

Solution

From the hgrc docs section on "hooks" -

"incoming"
  Run after a changeset has been pulled, pushed, or unbundled into the
  local repository. The ID of the newly arrived changeset is in
  "$HG_NODE". URL that was source of changes came is in "$HG_URL".

or...

"post-<command>"
  Run after successful invocations of the associated command. The contents
  of the command line are passed as "$HG_ARGS" and the result code in
  "$HG_RESULT". Parsed command line arguments are passed as "$HG_PATS" and
  "$HG_OPTS". These contain string representations of the python data
  internally passed to <command>. "$HG_OPTS" is a dictionary of options
  (with unspecified options set to their defaults). "$HG_PATS" is a list
  of arguments. Hook failure is ignored.

(The documentation also goes into detail about what the config should actually look like and how hook scripts are called.)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top