TortoiseHg Reviewboard extension available for testing

13 Sep

I have finished my first fairly stable version of a Reviewboard extension for TortoiseHg that allows you to post reviews to reviewboard directly from the TortoiseHg repository explorer.


This is the first application I have written in Python and I must say I really like the language. Its elegant, intuitive and very easy to pick up. Coming from C based languages like PHP and C#, Python, at first takes a little bit to get used to. This is mainly due to the significance of white space and layout of the code therefore I found myself tacking semicolons onto most statments and looking for curly brackets around code bocks.

I used Jetbrains PyCharm IDE which is very simmilar to PhpStorm therfore making development a breeze because I already knew most of the IDE idioms. Most of the code I wrote myself using examples for other areas of TortoiseHg. The post review code is based on the Reviewboard plugin for Mercurial which can be found here.

The Post Review UI

The post review feature can be accessed from the TortoiseHg context menu by right clicking on the revision that you would like to diff to and post to review board. You can either choose to post a new review request or update an existing one.

TortoiseHg context menu with Review Board sub menu

TortoiseHg context menu with Review Board sub menu

Choosing “Post Review” will load the post review dialog that will connect to reviewboard with the credentials you have set in the settings section. This is done via the reviewboard API and will get a list of repository ID’s that are set up on your reviewboard. Once loaded the user can enter the summary of the review they are about to post and choose from two options.

  1. Include all outgoing change sets – This will create a diff comparing all your change sets in the current branch to with your upstream repository.
  2. Publish immediatly – This will publish the review request immediately

Clicking the “Post Review” button will create a diff for the selected revision and upload it to the reviewboard server with the summary inputted and the option selected. The description will contain each change set and its commit message.

Once the review request is created a link to the address will be opened in the browser set in the Reviewboard options within the TortoiseHg settings.

The Reviewboard dialog for a new review request

Choosing “Update Review” will load a similar dialog to the one above where instead of a list of repositories, you will get a list of existing review requests for the current day.  Also, in addition to the two options above you will get an option to override the description originally posted to reviewboard.

The update review dialog

In order to connect to a reviewboard installation you will need to set the path, user and password for reviewboard, as well as the full path to your favorite browser in the TortoiseHg settings dialog under the new Reviewboard tab.

NOTE: Currently the password is stored in CLEAR TEXT and will be saved as such in the TortoiseHg settings file. I do plan to change this in the future.

Reviewboard settings within the TortoiseHg settings dialog


The reviewboard extension has been merged with the “default” branch of TortoiseHg. These days this branch is very much the same as the “stable” branch of TortoiseHg due to most, if not all, of the development happening in the Qt version of TortioseHg.

Windows Vista/7

  1. Download and install TortoiseHg from if you haven’t already got it
  2. Clone the TortoiseHg with Reviewboard extension source from
  3. Open Windows Explorer with Administrator privligaes and navigate to your TortoiseHg installation directory. Usually “C:\Program Files (x86)\TortoiseHg” for x64 windows, for x86 windows omit (x86).
  4. Copy “tortoisehg_reviewboard\icons\reviewboard.png” from the cloned location to the “icons” directory
  5. Copy the original “” archive to a new location as a backup
  6. Open the library zip archive as Administrator
  7. Open another Windows Explorer window and navigate to where you cloned the Reviewboard extension source
  8. Copy the contents of ‘tortoisehg_reviewboard\reviewboard’ into ‘\hgext\’
  9. Add ‘reviewboard =’ after ‘;mercurial_keyring =’ in ‘C:\Program Files (x86)\TortoiseHg\hgrc.d\Mercurial.rc’
  10. Navigate to “tortoisehg\hgtk\” within the archive and overide its contents with that of “tortoisehg_reviewboard\tortoisehg\hgtk” you just cloned
  11. Save and close the archive

Ubuntu Linux

  1. Install TortoiseHg via the Ubuntu Software Centre
  2. Clone the TortoiseHg with Reviewboard extension source from
  3. Open a terminal window an cd to where tortoisehg is installed – Eg. “/usr/lib/pymodules/python2.6/tortoisehg”
  4. Move the hgtk folder to a backup directory – Eg. ”sudo mv hgtk hgtk_bak”
  5. Create symbolic link or copy the hgtk directory to here from the location that you cloned the reviewboard extension above – Eg. “sudo ln -s hgtk ~/Documents/tortoisehg_reviewboard/tortoisehg/hgtk/”
  6. Cd to “/usr/lib/pymodules/python2.6/hgext” (Create hgext if it does not already exist)
  7. Create a symbolic link or copy the reviewboard directory to here from the location that you cloned directory – Eg. “sudo ln -s reviewboard ~/Documents/tortoisehg_reviewboard/reviewboard/”
  8. Add ‘reviewboard =’ after ‘;mercurial_keyring =’ in the default hgrc file.\


There are still a few bugs here and there that I am ironing out whileist using the feature during my daily tasks.

A major one is an issue that is also present in the reviewboard extension for which I based my code on. When selecting a change set from a non active branch sometimes the diff does not get created correctly and causes reviewboard to error when trying to display the diff.

If you notice any more issues or request please post them to and I will look into them.


Tags: ,

  1. Mikey

    September 19, 2014 at 11:21 am

    Ok I found the issue.

    To fix it you will need to do the following:

    1. Pull the updated source and update the files within hgtk inside ‘\tortoisehg\hgtk\’
    2. Copy the contents of ‘tortoisehg_reviewboard\reviewboard’ into ‘\hgext\’
    3. Add ‘reviewboard =’ after ‘;mercurial_keyring =’ in ‘C:\Program Files (x86)\TortoiseHg\hgrc.d\Mercurial.rc’

  2. Rahul

    September 18, 2014 at 3:20 pm

    Hi I am using TortiseHg on windows.

    My installed version is having *.pyo files in library\tortoisehg\hgtk folder when I copy all files from “tortoisehg_reviewboard\tortoisehg\hgtk” Tortise
    HG does not work.

    Thanks in advance..