I have CruiseControl.NET configured using the Mercurial source control block. When I first executed the build, the code was downloaded from my Kiln repository and the build went off without a hitch. However, every subsequent build fails, and I believe the reason is because hg.exe pull is returning an “error” code of 1 indicating there were no changes detected. I verified the return code by using Process Explorer. The thing is, CruiseControl.NET is apparently treating this as a failure condition but I’d prefer if it simply did not treat the attempt as a build. It’s been my experience that with other source control systems, CruiseControl.NET will simply do nothing if there are no changes in the repository.
[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
My question is, is there a CruiseControl.NET configuration I can use to get it to ignore the build attempt if hg.exe pull results in a 1, or am I going to have to go modify CruiseControl.NET code?
I’m using CruiseControl.NET 1.6 and Mercurial 2.1.
The problem is that Mercurial 2.1 changed the return code for
hg pullwhen no changesets were pulled. That is a backwards incompatible change and scripts and tools will now have to be updated to take this into account.I expect the next version of CruiseControl.NET to take this into account. In the mean time, a small batch file can be used (as you suggest in your comment).