Mercurial Checkout Rules Problem
Hi,
We recently upgradd to TeamCity 4.5.3 and have been loving it. We also installed the latest stable Mercurial Plugin release after moving our project to hg. Our project requires checking out a few different repositories (FOO, FOO2) with a final structure that looks like
FOO
|-BAR
|-BAZ
FOO2
|-BAR2
|-BAZ2
TeamCity Mercurial's default checkout behavior seemed to be to check out the repositories in a flat manner, IE: Using a VCS root for FOO and a VCS root for FOO2 in the project configuration yields a working directory
BAR
BAR2
BAZ
BAZ2
To get our necessary directory structure, I attempted to make a checkout rule for each repo in the formats "+:.=>FOO" and ".=>FOO" as the mercurial plugin page says is supported, but both times ended up with a working directory with the folder "FOO" created, but with nothing inside, and the same flat checkout from before IE:
FOO\ (empty)
FOO2\ (empty)
BAR
BAR2
BAZ
BAZ2
My understanding of the checkout rules from using the SVN VCS roots was that ".=>FOO" should create folder FOO and move all of the elements for the VCS root into that directory. When we were using SVN I set up the projects in that manner and they worked succesfully. Is this a misunderstanding of what the ".=>FOO" checkout rule is capable of? If so, is there a way to check out each Mercurial repository into its own directory by configuring the vcs settings or the configuration rules?
Thanks,
-Clayton Sims
Please sign in to leave a comment.
It looks like a bug, could you please try to change checkout mode to "checkout on agent" (you'll have to install mercurial on agents in this case).
Pavel,
Thanks for the Quick followup!
I've changed the checkout mode to checkout on agent, and now the build process gives me back this error for the first checkout it attempts
[04:37:28]: [Updating project sources] Clean sources required
[04:37:28]: [Updating project sources] Cleaning C:\TeamCity\buildAgent\work\9401610b4bc8af57\javarosa-core
[04:37:28]: [Updating project sources] Cleaning C:\TeamCity\buildAgent\work\9401610b4bc8af57\j2merosa
[04:37:28]: [Updating project sources] Cleaning C:\TeamCity\buildAgent\work\9401610b4bc8af57\j2merosa-util
[04:37:28]: [Updating project sources] Cleaning C:\TeamCity\buildAgent\work\9401610b4bc8af57\j2merosa-examples
[04:37:28]: [Updating project sources] Cleaning C:\TeamCity\buildAgent\work\9401610b4bc8af57\j2merosa-activities
[04:37:28]: [Updating project sources] J2MERosa; checkout rules: =>j2merosa ; revision: 661:8ffa8a1f4624
[04:37:28]: [Updating sources] jetbrains.buildServer.vcs.VcsException: Include rule with mapping is not supported: =>j2merosa jetbrains.buildServer.vcs.VcsException: Include rule with mapping is not supported: =>j2merosa at jetbrains.buildServer.buildTriggers.vcs.mercurial.MercurialAgentSideVcsSupport.updateSources(MercurialAgentSideVcsSupport.java:33) at jetbrains.buildServer.agent.impl.vcs.CheckoutByIncludeRuleAdapter$1$1.process(CheckoutByIncludeRuleAdapter.java:28) at jetbrains.buildServer.agent.impl.vcs.CheckoutByIncludeRuleAdapter$2.updateSources(CheckoutByIncludeRuleAdapter.java:49) at jetbrains.buildServer.agent.impl.patch.ProjectSourcesOnAgent.checkoutSources(ProjectSourcesOnAgent.java:61) at jetbrains.buildServer.agent.impl.patch.ProjectSourcesGetter.checkoutSources(ProjectSourcesGetter.java:269) at jetbrains.buildServer.agent.impl.patch.ProjectSourcesGetter.execute(ProjectSourcesGetter.java:123) at jetbrains.buildServer.agent.impl.runStages.CheckoutSourcesStage.doGetSources(CheckoutSourcesStage.java:45) at jetbrains.buildServer.agent.impl.runStages.CheckoutSourcesStage.doRecoverableStage(CheckoutSourcesStage.java:31) at jetbrains.buildServer.agent.impl.runStages.RecoverableBuildStage.doBuildStage(RecoverableBuildStage.java:61) at jetbrains.buildServer.agent.impl.BuildRunAction.doStages(BuildRunAction.java:135) at jetbrains.buildServer.agent.impl.BuildRunAction.access$000(BuildRunAction.java:21) at jetbrains.buildServer.agent.impl.BuildRunAction$1.run(BuildRunAction.java:91) at java.lang.Thread.run(Thread.java:595)
[04:37:28]: Build finished
If I don't include the checkout rule for any of the repos, the checkout for that repository succeeds, but in the flat working directory format.
Please try to install this build: http://teamcity.jetbrains.com/viewLog.html?buildId=22991&buildTypeId=bt121&tab=artifacts
It should support checkout rules of the form .=>subdir for checkout on agent.
Pavel,
Thanks again for the quick responses. I installed this updated version of the plugin, and it does now recognize the checkout rules, although there is a new odd behavior.
When I specify (for repository FOO)
.=>FOO-REPO
as a checkout rule. I now get the a directory structure two copies of FOO-REPO. IE:
FOO-REPO
|-FOO-REPO
|-BAR
|-BAZ
|-.hg
In comparisson, when I provide no checkout rule I once again get the flat checkout structure
BAR
BAZ
.hg
I assume this is a bug with the code for the new plugin version?
Thanks again,
-Clayton
Ok, my fault, this build should work: http://teamcity.jetbrains.com/viewLog.html?buildId=22997&tab=buildResultsDiv&buildTypeId=bt121
At least it works in my case.
Pavel,
This revision checks out in the expected manner.
Thanks for all your help.
-Clayton