TeamCity/Mercurial - broken patch - mercurial

I've set up TeamCity (v6.5.5 - build 18087) to build an ASP.NET project from Mercurial. Twice in 56 build now I have got the error below, and the only common denominator I can see is that these changesets had files added to them.
If I clear the server's mercurial cache I get rif of the problem until next time, but that's not a great solution.
I've seen posts from people with similar problems, but haven't found a solution from reading them.
Would be thankful if someone can point me in the right direction here.
From TeamCity build log:
[20:54:21]: Patch is broken, can be found in file: C:\BuildAgent\temp\cache\temp547491181020464280patch_64
[20:54:21]: Failed to build patch for build #56 {build id=64}, VCS root: mercurial: http://server:8000 {instance id=1, parent id=2}, due to error: 'cmd /c hg cat -o C:\TeamCity\temp\mercurial9111169551826812670catresult\%p -r 75f205de9192 website\MasterPage.master website\MasterPage.master.designer.cs website\OurProject.csproj website\Login.aspx website\Login.aspx.designer.cs website\apage.aspx website\apage.aspx.designer.cs website\anotherpage.aspx website\anotherpage.aspx.designer.cs website\thirdpage.aspx website\thirdpage.aspx.designer.cs' command failed. stderr: abort: data/website/thirdpage.aspx.i#2b64b5d6eb86: no match found!
jetbrains.buildServer.agent.impl.patch.PatchDownloaderImpl$1: Server was not able to build correct patch, most likely due to VCS errors, will try again. at jetbrains.buildServer.agent.impl.patch.PatchDownloaderImpl.throwError(PatchDownloaderImpl.java:113) at jetbrains.buildServer.agent.impl.patch.PatchDownloaderImpl.checkPatch(PatchDownloaderImpl.java:103) at jetbrains.buildServer.agent.impl.patch.PatchDownloaderImpl.copyPatchAndCheck(PatchDownloaderImpl.java:64)...

Related

Mercurial error on commit: "abort: phases.new-commit: not a valid phase name ('')"

I'm getting the following error when attempting to commit to a Hg repository:
Z:\wormcard_maker>hg commit -m "asdf"
transaction abort!
rollback completed
abort: phases.new-commit: not a valid phase name ('')
This happens over multiple different repositories and has survived re-cloning the repository and reinstalling Mercurial. I can commit to the repository fine from a different computer (running Linux).
I'm running Hg 4.8 as distributed with TortoiseHg 4.8 on Windows 7.
In TortoiseHg just set the "File - Settings - Commit - New Commit Phase" option.
I tried using the THG setting but it didn't work; just kept producing the same error.
(While doing this I noticed that the THG dropdown for the phase choices had a bunch of blank lines in it; so I think THG was confused.)
Instead I manually edited my HGRC file and made sure it contained:
[phases]
new-commit = secret
which worked.
You could obviously use draft, etc. in place of secret.
Neither of the other answers worked for me - even though I had new-commit = secret in the HGRC it still produced the error.
The workaround I found was to do this:
hg ci -m "message" --config phases.new-commit=secret
which did work, apparently by overriding whatever invalid phase name hg was trying to use. Even though I don't know why.
I assume this would work with other comments, not just ci (aka commit).

Mercurial on Phabricator: "remote: abort: stream ended unexpectedly"

I'm having this problem when trying to push to a remote server. It is a Mercurial repository on Phabricator. Here are my output.
hg commit -m "udpate README"
hg push
pushing to ssh://company.server
searching for changes
remote: abort: stream ended unexpectedly (got 0 bytes, expected 4)
I'm using the latest version of Mercurial 3.5.2+20151001 on Mac OS 10.10.
I have this problem from yesterday. During that time, I could successfully committed two times, although I did nothing.
Why the output somewhat looks like this question, the problem here is different, because I have deleted the repository and cloned again many times without any problem. (my first attempt to solve the problem)
The system admin and the server is at another city, so he can't take a look at my machine. Any help would be greatly appreciated.
This looks like there may be a problem with the server and client disagreeing on the new bundle2 format for the wire protocol introduced in 3.5. I'd recommend trying to temporarily downgrade to 3.4.2 (e.g. with pip install mercurial==3.4.2) to see if it fixes this. See this discussion on Phabricator. If it doesn't work, hg push --debug --traceback can provide more information on what exactly went wrong.

Hg TortoiseHg commit error on Windows 7

I clone a new repository by TortoiseHg version 2.1.3. Then do some change. When I do commit, I get this message as below.
My desktop drive mapping is connected to Linux server by Samba.
I am so appreciate if someone can help.
% hg commit --repository V:\htdocs\critical\mysite2 --verbose --user MyUser --message=testing Mercuial V:\htdocs\critical\mysite2/application/controllers/package.php
smartdox/application/controllers/package.php
transaction abort!
rollback completed
abort: The process cannot access the file because it is being used by another process
[command returned code 255 Fri Jan 13 14:30:17 2012]
mysite2%
For me changing the setting:
Global Settings -> TortoiseHg -> Monitor Repo Changes
to
localonly
helped.
The long discussion in the official bug tracker: https://bitbucket.org/tortoisehg/thg/issue/889/
I've seen this same problem, but I've noticed that "occasionally" I am able to commit changes. I think the 'another process' is something on the server.
When I fail to commit, hg gives an error saying (among other things) "transaction abort! rollback failed - please run hg recover".
If I run hg recover, sometimes that fails, too (in use by another process). If I wait a minute or two, then retry to recover, it often succeeds.
Once the recovery succeeds, if I wait another minute or two, then the commit often succeeds when I retry it.
My theory is that the server is indexing or virus-scanning the contents of .hg/
I don't know a guaranteed work-around, but on my small repository I can often get my changesets in if I give it a try or two. Your luck is likely to increase as the activity on your repository files decreases.
I don't really know about committing, but I know that Mercurial/TortoiseHG has issues when you push to a Linux drive which is mapped under Windows.
See these answers I wrote about it:
Mercurial remotes on the file system instead of http server
Can you 'push' to network share using Mercurial on 64bit Windows 7?
Maybe the same problems occur when the repository you're trying to commit to directly resides on a mapped Linux drive.
I'd suggest that you put the repository on a real Windows drive and try if you can commit there.
If yes, the problems you described are probably because of the Linux drive.

MVN release:prepare with Mercurial push FAIL

Here's the steps I take:
Clone mercurial project at the head.
On local repository, perform hg status (no results), then hg in (no changes).
mvn clean install. Build is successful.
mvn release:prepare.
Get's to the point where it's excuting a push
[INFO] EXECUTING: cmd.exe /X /C "hg push http://remoterepo/hg.project"
[ERROR]
EXECUTION FAILED
Execution of cmd : push failed with exit code: -1
Your Hg installation seems to be valid and complete. Hg version: 1.8.4 (OK)
Doing a hg status I now have:
? pom.xml.releaseBackup
? release.properties
From my understanding is that this happens when it could be creating a branch on the remote repo and the fix is to make sure I'm on the head. I'm on the head.
I've done this several times before and now this happens. Let me reiterate, I cloned the head and I couldn't clone a branch if I wanted to as none exist.
Now what? How do I fix this?
Thanks for any suggestions.
Joe
I figured it out. It was a authentication thing. The Maven release plugin does not use the authentication details in <project>/.hg/hgrc but it DOES in /<Users>/<UserName>/.hgrc. After I updated my password everything worked just fine.
First of all what happens when you try to do an hg push yourself on the command line ? If everything's fine you definitively have a problem, otherwise the error message should help you determine what is going wrong.
If I were you, I would check if I have the right to push to the remote destination.
Is http://remoterepo/hg.project the real output or did you changed it for confidentiality reason ? If it's the real output, you should check your Maven configuration to put the real repository path.
Concerning the output of hg status after the steps, it's totally normal, Maven creates some file in the directory. You can add them to your .hgignore file so Mercurial won't show them to you. More information about that in the documentation.

"Crosses Branches" error with Mercurial and CruiseControl.Net

We are migrating to Mercurial, and of course, we need to update our CruiseControl.Net build process to use it instead of Visual SourceSafe.
We updated our CruiseControl config file with the following block:
<sourcecontrol type="hg" autoGetSource="true">
<executable>C:\Program Files\Mercurial\hg.exe</executable>
<repo>https://bitbucket.org/GTSDevs/galaxy</repo>
<workingDirectory>C:\Cruise Control\Releases\5.0.0\source</workingDirectory>
<branch>master</branch>
<multipleHeadsFail>false</multipleHeadsFail>
<tagOnSuccess>true</tagOnSuccess>
<timeout units="minutes">20</timeout>
</sourcecontrol>
This worked well until we pushed some code to our repository with a branch in it. Now our build fails with the following error:
ThoughtWorks.CruiseControl.Core.CruiseControlException: Source control operation failed: abort: crosses branches (merge branches or use --clean to discard changes)
. Process command: C:\Program Files\TortoiseHg\hg.exe update -r master --noninteractive
at ThoughtWorks.CruiseControl.Core.Sourcecontrol.ProcessSourceControl.Execute(ProcessInfo processInfo)
at ThoughtWorks.CruiseControl.Core.Sourcecontrol.Mercurial.Mercurial.GetSource(IIntegrationResult result)
at ThoughtWorks.CruiseControl.Core.IntegrationRunner.Build(IIntegrationResult result)
at ThoughtWorks.CruiseControl.Core.IntegrationRunner.Integrate(IntegrationRequest request)
All the information I can find on the error appears to pertain to doing an update.
Can anyone help out with getting past this?
Is there something more we should be doing in our ccnet.config file to support Mercurial?
Some ideas:
the best way would be to add a new parameter to the Mercurial source control block in order to add the --clean command line parameter
mercurial support in CruiseControl.NET - how to clean & update build folder?