Mercurial:如何在拉上添加钩子

时间:2013-04-11 15:55:36

标签: mercurial mercurial-hook

我已经搜索了一段时间,但没有看到任何东西。这可能意味着,它不应该被完成或者它无法完成。

我查看了mercurial的一个钩子列表,在你给出hg pull命令后,我似乎无法找到(或者让一个工作)执行脚本。

谢谢

1 个答案:

答案 0 :(得分:3)

来自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".

...或

"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.

(文档还详细介绍了配置的实际内容以及如何调用钩子脚本。)