Teamcity VCS build all and only default branch commits


I am confused about Teamcity settings regarding branches and branch filters with Mercurial. I am trying to setup our first build configuration for our staging branch. I want the build config to run a build for each commit made on our "Test" branch, and not sure if relevant but each commit will always be a merge from a feature branch.

Here are the settings, and I'm guessing I must not understand how some of these settings work. I have a Mercurial VCS root for our repo; default branch "Test". On the build configuration version control settings the branch filter is set to "+:Test".

My trigger is a VCS trigger with the setting to "Trigger a build on each check-in" but not to include multiple from the same committer. I have the repo setup with a commit hook to trigger check for changes.

This doesn't work as the build is not building every commit on Test, and it is building commits of the branches merged into Test.

Comment actions Permalink



I'm going to try to go through the basics of how teamcity handles this. From your description I'm not sure if there is something wrong just yet, but branches in mercurial can be a slightly confusing topic, so if you go through this and do not find the problem, please share screenshots of your trigger, vcs settings, and the changes of a build that were changes on a different branch.


The default branch is used by teamcity to have a reference point for all other branches when required. Branch specification allows adding more branches, but if you only want to track one branch it's not required, and you also don't need to add a branch filter, as teamcity will only track the branches defined in default branch and specification. This is important, as doesn't make much sense following your description. Given that a merge commit should be self contained and not require knowing of other branches, just have a reference to a separate parent, it should not be building "commits" of the other branches.


The VCS Root only tracks the changes, but does no action on them. Whenever there are new changes, they will be attached to the build configuration if they match the requirements (checkout rules, branch, etc), and then the triggers will take action. "Trigger a build on each check-in" means that if in the time between two checks 3 different commits arrive, teamcity will trigger 3 different builds instead of one build with 3 commits.


With this in mind, if you only track Test, and teamcity is building changes from other branches, please share a screenshot of the VCS Config and the changes from other builds (preferably showing the mercurial history as well where it shows them in other branches)

Comment actions Permalink

I just setup a test project and build config with a new test repo to try to reproduce the issue. It worked correctly the first merge, but the second merge caused it to build a commit on the Feature1 branch in addition to the merge commit. I have only default branch as Test with no other specification. Under the advanced version control settings the branch filter defaulted to +|*, but from the VCS root I would expect this to only see Test since the VCS root doesn't track other branches.

A view of the commits in Mercurial (tortoisehg)


The VCS Root

The VCS Trigger

Edit: The Change Log of the builds

Comment actions Permalink

Thanks for the screenshots, I've seen that you also posted to our issue tracker here:

The issue has been reassigned to a new dev, so I'd recommend tracking it for changes soon


Configuration seems correct from what I can tell, so I can only recommend watching the issue so that when the dev is available she can discuss the details. Your case seems much more basic than the one initially reported which might make it easier to locate. This said, this works fine most of the time, so there might be something else in the environment leading to the issue.


Please sign in to leave a comment.