Mercurial:如何在拉上添加钩子

ut_quo 发布于 2019-03-09 mercurial 最后更新 2019-03-09 14:32 3 浏览

我为此搜寻了一段时间,并没有看到任何东西。这可能意味着,它不应该被完成,或者它不能完成。 我查看了一个mercurial的钩子列表,我似乎无法找到(或得到一个工作)在执行hg pull命令后执行脚本。 谢谢

已邀请:

ha

赞同来自:

来自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.
(文档还详细介绍了配置应该是什么样子以及如何调用钩子脚本。)