Re: Integration with Kiln's Mercurial

I have a different problem. We are also using Kiln to manage version control with Mercurial. I am creating a configuration, attaching a VCS to it, testing the connection and then I click Run. Let's say my module's name is XYZ and I check out everything under a root folder named ROOT. Here is my configuration. In Version Control Setings, in VCS root configuration, I specify that the module should be cloned to C:\ROOT\XYZ. Also, my checkout directory is C:\ROOT\XYZ. What happens when I say Run is that, the module gets checked out but without a .hg folder and because of that, the project cannot be compiled. I realized that, first the version info gets checked out and then it is wiped out when the module itself is cloned. So, I applied a different configuration.

Clone repository to directory in VCS root configuration: C:\ROOT.
Checkout directory in Version Control Settings: C:\ROOT\XYZ\XYZ.

This works fine, but still the .hg folder gets created under C:\ROOT\XYZ and the module is checked out under C:\ROOT\XYZ\XYZ.

If I clone a repository under C:\ROOT\XYZ, using a client program, everything is checked out under C:\ROOT\XYZ and also the .hg folder is created at the same place. I want TeamCity to do the same.

By the way, we are using TeamCity 5.1.4.

Any help is appreciated. Thanks.

3 comments
Comment actions Permalink

Hi

Could you clarify why does the build fail - do you perform any VCS-related operations there? A build log with errors would be helpful.

Usually we recommend to leave both Clone repository to and Checkout directory options blank. TeamCity will clone a repository to a folder under <TeamCity Data>\system\caches\mercurial\, and export working copy to a folder under <TeamCity Agent>\work\.

Note that TeamCity server and build agents can be installed on different machines. Then these settings refer to locations on different computers.


By default working copy does not contain a repository clone. If you need to perform actions in Mercurial right from the build, then change VCS checkout mode to Automatically on agent.

Michael

0
Comment actions Permalink

Thank you for the quick response. When VCS Checkout Mode is Automatically on the Server, and Clone Repository To and Checout Directory are empty, I get the following error:

[ERROR] BUILD ERROR

[INFO] ------------------------------------------------------------------------
[INFO] Command failed.
EXECUTION FAILED
Execution of cmd : id failed with exit code: -1.
Working directory was:
C:\BuildAgent\work\a0388e26d68bc0c9
Your Hg installation seems to be valid and complete.
Hg version: 1.8.2 (OK)
When VCS Checkout Mode is Automatically on the server and I apply the practice I described before, I get the same error, except that the working directory is different.
When I make VCS Checkout Mode Automatically on the agent and leave Clone Repository To and Checkout Directory empty, it works fine.
So, my conclusion is that, as a best practice, leave Clone Repository To and Checkout Directory empty, and make VCS Checkout Mode Automatically on the agent, if you want to use Mercurial efficiently with TeamCity.
0
Comment actions Permalink

I'm glad it works now.

But to explain root cause of the issue I would need to see full build log.

Michael

0

Please sign in to leave a comment.