In the past I have used Gerrit which was configured together with Jenkins (by use of Gerrit trigger) to trigger CI build/test for each patch set that was pushed into Gerrit. And a special label was configured in Gerrit which could only be set from Jenkins after CI build finished. Setting value +1 on this label was required to permit merge of the patch set to the main repository. And if Jenkins set it to -1 that would mean that either build or tests failed. The idea is simple, merge can be allowed only if CI tasks successfully completed, which means anything merged cannot really break the build, code in main repository can always be compiled and always passes unit tests. Now, I have to use Mercurial for source control and would like to set up something similar. I am looking at Upsource as an alternative to Gerrit. Can something similar be set up with Upsource? Anf if so is there any documentation to this matter?