Mercurial code reviews

Mercurial code reviews

Deveo supports managing Git, Mercurial and Subversion repositories. In addition to advanced access management, code browser including code commenting, it is also possible to conduct code reviews with both Git and Mercurial version control systems. We have covered code review process using feature branches in Git repositories in a previous posting. This post describes a step-by-step guide for conducting code reviews using Mercurial branches. Deveo also supports code reviews with Mercurial bookmarks, that we will describe in another blog post later on.

If you are more of a "watch it" rather than "read it" type, you can also watch the workflow from the youtube video below:

For the purpose of doing code reviews with Mercurial in Deveo, we need a new project and a Mercurial repository in Deveo. Setting these up happens in three easy steps that we are not going to go through for the sake of keeping this post short. We instead go right into the good stuff by creating and committing a file to the default branch in your repository. After the first commit, create a new branch with the hg branch feature command. This will create a new branch named feature. Do some changes to the file you created earlier and commit the changes. Push everything using hg push --new branch. The --new-branch switch will push newly created branches in addition to the default branch. After the push, you can see the two branches from Deveo's code browser.

Two Mercurial branches in Deveo code browser

After you see the branches in the Deveo code browser, you can go and create a code review between the branches. For the sake of simplicity, we will not set the required number of approvals or successful build requirement, but simply set the title and description and create a new code review between the two branches.

Creating a new Mercurial code review in Deveo

The code review details in Deveo shows the discussion, commits, and changes views. The discussion view shows the audit log for the code review, basically, everything that happens during the review. The commits view lists the commits in the branch and the Changes view shows the changes between the feature branch and the base branch.

Mercurial code review view in Deveo

When we consider that the changes are good to go, we merge the changes using the merge button. We can also close the Mercurial branch with the same go.


Conducting code reviews with Mercurial branches are as easy as you might guess. Deveo allows you to create, comment and collaborate, approve or decline, and finally, merge and close the branch.

In addition to Mercurial branches and Bookmarks, there's some planning done for supporting topic branches in Mercurial. Topic branches are somewhere between branches and bookmarks and are intended to be used for feature branching. Deveo will surely support topic branches when or if they are released in an official Mercurial release.

How does your team conduct code reviews with Mercurial? Share your comments below.

Not using Mercurial? Here's a guide that you might find interesting:

Seamless software development.

Code management and collaboration platform with Git, Subversion, and Mercurial.

Sign up for free
comments powered by Disqus