"Crosses Branches" error with Mercurial and CruiseControl.Net - mercurial

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?

Related

mercurial: How to switch to non-rust based hg build

I am working with a mercurial repository and switched from installing hg via one package manager (nix) to another (guix).
Now I get the error message
% hg pull
abort: accessing `persistent-nodemap` repository without associated fast implementation.
(check `hg help config.format.use-persistent-nodemap` for details)
And cannot interact with the repo anymore. How can I circumvent hg's attempt at trying to use persistent-nodemap. my repo is a few lines of code and I don't need any performance optimisation.

TeamCity/Mercurial - broken patch

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)...

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.

Mercurial usage throws error. please tell me what's wrong?

https://www.mercurial-scm.org/guide please visit this link.....right now i successfully install mercurial but next step not i am clear.....
Initialize the project
Now you add a new folder in which you want to work:
$ hg init project
Add files and track them
$ cd project
$ (add files)
$ hg add
$ hg commit
(enter the commit message)
add file means i dont know...can u explain please
now i am using ubuntu....
mercurial installation step1:
embdes#embdes-laptop:~$ sudo apt-get install mercurial
[sudo] password for embdes:
Reading package lists... Done
Building dependency tree
Reading state information... Done
mercurial is already the newest version.
The following packages were automatically installed and are no longer required:
libopenal1 wavpack kdelibs4c2a libdc1394-22 mppenc vorbis-tools libxvidcore4
libldns1 libsvga1 kdelibs-data mplayer kdemultimedia-kio-plugins liblualib50
libkcddb4 mp3gain vorbisgain speex libmp3lame0 faad libavahi-qt3-1 icedax
freepats ffmpeg libao2 liblzo2-2 libavfilter0 flac libev3 timidity libqt3-mt
liblua50 timidity-daemon libunbound2 libavdevice52
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 261 not upgraded.
embdes#embdes-laptop:~$
step:2
embdes#embdes-laptop:~$ hg init project
abort: repository project already exists!
embdes#embdes-laptop:~$ cd project
embdes#embdes-laptop:~/project$ hg add
embdes#embdes-laptop:~/project$ hg commit
nothing changed
embdes#embdes-laptop:~/project$ hg init
abort: repository . already exists!
embdes#embdes-laptop:~/project$
This is the output from my commandline. Please correct me if I have done anything wrong.
The android project I develop will reside in the following directory,
/home/embdes/workspace
The following is the android sdk directory
/home/embdes/project/android/android-sdk/platform-tools/
how to install mercurial?
how to use android engine example project in my eclipse?
I am new in using commandline, so please help me in clearing above two doubts.
Thanks
You need to create files that are going to be version controlled. It is that simple.
You will find a full step-by-step tutorial at hginit
For instance, after an hg add, you need an hg commit:
There’s still one more step… you have to commit your changes. What changes? The change of adding all those files.
Why do you have to commit?
With Mercurial, committing says “hey, the way the files look right now—please remember that.” It’s like making a copy of the whole directory… every time you have something that you’ve changed that you sorta like, you commit.
When you issue the init command you are telling mercurial to track changes within the directory for a list of files... with the add command you tell mercurial which are these files.
By issuing the add command without any parameters you're telling mercurial to revision-control ALL the files within the "project" directory (recursively).
At any given time you can "forget" a file... and it will still be within "project" (directly or not) but mercurial won't care about any changes to the file.
You have to first get a basic understanding of what mercurial is for. Mercurial is a version control system which can store the changes you make your files. In your commandline output it is obvious that you have no files inside the,
/home/embdes/project
directory. That means you have made no change. Then what will mercurial store?? So only it says nothing has changed. You just create new files or directories there. Then do hg add. You will see the difference :)

Mercurial/Intellij9 hg4idea Error: cannot update with applied MQ patches, please use rebase

I am getting the following error when trying to update my project from Intellij 9 using hg4idea:
Error: cannot update with applied MQ patches, please use rebase
What does this mean? I have not created or applied any patches as far as I know. I can pull changes from my remote repository but cannot update the project from within Intellij. I can call hg update from the command line and that works fine.
Thanks
It's a known issue of the hg4idea plug-in. The author suggests the following workaround:
Enable mq extension in your .hgrc:
[extensions]
hgext.mq =