Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/mercurial/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/jenkins/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mercurial变更组挂钩:存储库URL_Mercurial_Jenkins_Mercurial Hook - Fatal编程技术网

Mercurial变更组挂钩:存储库URL

Mercurial变更组挂钩:存储库URL,mercurial,jenkins,mercurial-hook,Mercurial,Jenkins,Mercurial Hook,在Mercurial repository服务器上,如何在变更组-或类似的-hook中找出当前存储库URL或至少名称(子路径)?我正在IIS上运行HgWeb $HG_URL返回pushers URL,而不是接收存储库的URL$HG_SOURCE仅返回服务 上下文:我正试图使用/mercurial/notifyCommit?url=为Jenkins编写一个changegroup钩子,它告诉Jenkins执行SCM轮询,如果我无法实现,我必须在每个changegroup触发器上执行大约50次cURL

在Mercurial repository服务器上,如何在
变更组
-或类似的-hook中找出当前存储库URL或至少名称(子路径)?我正在IIS上运行HgWeb

$HG_URL
返回
push
ers URL,而不是接收存储库的URL
$HG_SOURCE
仅返回
服务


上下文:我正试图使用
/mercurial/notifyCommit?url=
为Jenkins编写一个
changegroup
钩子,它告诉Jenkins执行SCM轮询,如果我无法实现,我必须在每个
changegroup
触发器上执行大约50次cURL调用(服务器上的每个存储库一次),然后记得永远在
hgweb.config
中维护此列表。

您的钩子将在该特定存储库的根文件夹中执行,您可以在bash中使用以下命令获取当前文件夹名称:

${PWD##*/}

根据Ton的回答,这就是我在Windows上所做的事情:

changegroup.jenkins.cmd

@for /f "delims=\" %%a in ("%CD%") do @set TOPMOST=%%~nxa
@curl.exe "http://jenkins/mercurial/notifyCommit?url=http://hgweb/%TOPMOST%" -s -S

有了这些知识,看看我自己的答案吧!