'hg pull'在CruiseControl.NET构建中失败,因为未检测到任何更改

时间:2012-02-09 16:43:43

标签: mercurial cruisecontrol.net

我使用Mercurial源控制块配置CruiseControl.NET。当我第一次执行构建时,代码是从我的Kiln存储库下载的,构建工作顺利完成。但是,每个后续构建都会失败,我相信原因是因为 hg.exe pull 返回的“错误”代码为1表示没有检测到更改。我使用Process Explorer验证了返回代码。问题是,CruiseControl.NET显然将此视为失败条件,但我更愿意,如果它根本不将该尝试视为构建。根据我的经验,使用其他源代码控制系统,如果存储库中没有任何更改,CruiseControl.NET将无所事事。

[Project:DEBUG] Starting process [C:\Program Files\Mercurial\hg.exe] in working directory [D:\Working] with arguments [pull https://urlredacted]
[Project:DEBUG] Not setting PriorityClass on [C:\Program Files\Mercurial\hg.exe] to default Normal
[10:DEBUG] [Project C:\Program Files\Mercurial\hg.exe] standard-error stream closed -- null received in event
[9:DEBUG] [Project C:\Program Files\Mercurial\hg.exe] pulling from https://urlredacted
[6:DEBUG] [Project C:\Program Files\Mercurial\hg.exe] process exited event received
[9:DEBUG] [Project C:\Program Files\Mercurial\hg.exe] searching for changes
[9:DEBUG] [Project C:\Program Files\Mercurial\hg.exe] no changes found
[9:DEBUG] [Project C:\Program Files\Mercurial\hg.exe] standard-output stream closed -- null received in event
[Project:WARN] Source control failure (GetModifications): Source control operation failed: . Process command: C:\Program Files\Mercurial\hg.exe pull https://urlredacted

我的问题是,是否有一个CruiseControl.NET配置我可以使用它来忽略构建尝试,如果 hg.exe pull 结果为1,或者我将不得不去修改CruiseControl.NET代码?

我正在使用CruiseControl.NET 1.6和Mercurial 2.1。

1 个答案:

答案 0 :(得分:3)

问题是,当没有撤消任何变更集时,Mercurial 2.1更改了return code for hg pull。这是一个向后不兼容的更改,现在必须更新脚本和工具以将其考虑在内。

我希望CruiseControl.NET的下一个版本能够考虑到这一点。同时,可以使用小批量文件(正如您在评论中建议的那样)。