How to set build configuration VCS default branch to be a named hgflow release branch

Hi, I am using HgFlow and Mercurial for version control.

In my Team City build configuration in the VCS root settings I want to change the default branch.

My current settings are:

Default branch: default
Branch specification: +:release/*

Any changes to a named release branch i.e. "release/{my release name here}" are tracked by TeamCity and a build is run.
BUT it is also tracking changes to the default branch, usually this is not a problem, except for when a hotfix is performed.

How can I change the default branch to release only?

I have tried "release" and "+:release/" and "release/" in the default branch setting and none of them are working.

Thanks
Neil

10 comments
Comment actions Permalink

Do I correctly understand that your feature branches named 'release/{release_name}' and your default branch named just 'release' ?

0
Comment actions Permalink

The default branch is "default"

I also have a "develop" branch.

A "feature/{new feature name}" branch for features

and a "release/{new release name}" branch for doing releases,

so yes its similar to it being a feature branch but not the same.

I want to change the build configuration so its VCS root doesn't use "default" as it's default branch, I want it to only track changes made to the "release/*" branches

Is this possible?

0
Comment actions Permalink

There must be a default branch (not necessarily hg's default or git's /refs/heads/master) - it's the branch that build would be triggered against when you press run button (even if you don't specify it explicitly, it would be implicitly set to hg's default).

However, you can setup a VCS trigger branch filter to trigger builds only in desired branches.

0
Comment actions Permalink

What I am asking is

Can I set the default branch for a build configuration VCS root to be "release/*" ?

As mentioned I have already tried a few different ways and none work.

I can't leave it as the "default" branch aka master branch by default because then any hotfixes that are finished (closed and merged into default/master) causes this build configuration to deploy again wiping out any changes that were in a recent release branch that has not been finished yet (closed and merged into default & develop branches)

This is all related to the usual HgFlow process of default, develop, release, feature, hotfix, surely you have some other people that use TeamCity with Mercurial in this way? instead of all the Git examples.

0
Comment actions Permalink

Default branch cannot contain wildcard. It must be exactly one particular branch. And the build against this branch will be executed when you press run button on build configuration page. So, you need to site what branch it should be.

0
Comment actions Permalink

Ok so is there a way that I can get the build configuration to ignore what I put in as the default?

If I change the default to "develop" branch then every time I make a development change the changes done in the release branch that were already deployed will be removed.

and if I leave it as the "default" aka master branch then every time a hotfix branch is finished and merge in, the release branch changes will also be lost.

0
Comment actions Permalink

You can put any dummy branch here, that is not updated. But, if the commit to default branch triggers undesirable build steps, then your build configuration setup needs revision and refactoring. There are numerous ways to do the same sort of things in a more reliable way.

Snapshot dependencies and promote feature are the thing that usually help to sort this kind of things out.

0
Comment actions Permalink

It is not that the commit is triggering undesirable build steps.

It is just that the build configuration is tracking both "default" and "release/*"

and these 2 conflict with each other.

I have several build configurations, and your suggestion has made me realise that I can just remove the default branch for this configuration, hopefully this will work ok.

I will test it and see, then mark this as answered. Thanks for the help.

0
Comment actions Permalink

Hi, I am trying to achive same goal as OP

Sergey, can you elaborate how I can "setup a VCS trigger branch filter to trigger builds only in desired branches."?

0
Comment actions Permalink

Hi Michael,

You can configure the following branch specification:
Default branch: default
Brach specification: +:release/*

And configure VCS trigger with the following branch filter:
+:*
-:<default>

In this case the build will be triggered if there are changes committed to any branch except default. Please find more details in the related section in documentation: https://confluence.jetbrains.com/display/TCD9/Working+with+Feature+Branches.
At the moment it is not possible to configure build configuration without default branch. Please vote for the related request: https://youtrack.jetbrains.com/issue/TW-23395.

0

Please sign in to leave a comment.