Archive for the ‘TortoiseHg’ Category

TortoiseHg Reviewboard issue when updating existing reviews

30 Mar

I recently noticed a bug introduced into the mercurial-reviewboard plugin that is preventing a list of existing reviews from being displayed in the drop down list.

Basically there was a change added to skip the login prompt if the user already has a a valid cookie. Unfortunatly, in this case the username is never set in the http client that the pending_user_requests function relies on.

A simple change to line 484 fixes this issue.


if not httpclient.has_valid_cookie():
    if not username:
        username = mercurial.ui.ui().prompt('Username: ')
    if not password:
        password = getpass.getpass('Password: ')
    httpclient.set_credentials(username, password)


if not httpclient.has_valid_cookie():
    if not username:
        username = mercurial.ui.ui().prompt('Username: ')
    if not password:
        password = getpass.getpass('Password: ')

httpclient.set_credentials(username, password)

I have posted a new issue and patch to mdelgra’s BitBucket issue tracker, here, that fixes the issue.

Hopefully it will be fixed sooner rather then later, because it is affecting the dialog!

Comments Off

Posted in Python, TortoiseHg


TortoiseHg review board interface now uses a fork of the original extension

29 Dec

I originally wrote the TortoriseHg review board user interface to use a fork of Mdelagra’s fork of the original mercurial extension.

I have since made some changes to the UI I wrote earlier this year ( to make use of a fork of the original extension instead.

I did this because the original extension that is listed on the Mercural website ( has recently been update to support the Review Board API 2.0 that was shipped with Review Board 1.5. This updated API has some nicer features that I have implemented, namely, the more granular control over filtering review requests.

So I have forked the original and, among a couple of bug fixes, added some features to make it play nicer with the TortoiseHg review board dialog. This fork is now required to be used with TortoiseHg and can be downloaded here –

I have made contact with the developers of the original extension and hope to get my changes merged into it some time in the new year.

Hopefully before the release of TortoiseHg 2.0, however in the mean time my fork will have to suffice.


TortoiseHg Review Board dialog ported to PyQt for Thg 2.0

06 Nov

Over the last couple of weeks I have spent a lot of time porting the Review Board dialog I wrote for TortoiseHg to use the PyQt framework and the upcoming release of TortoiseHg 2.0.

Review Board is a powerful tool to increase the quality of code in any organisation. The Review Board Mercurial extension was an excellent way to submit diffs to the review board server directly from the command line. This dialog takes this simplicity to the next level by providing a way to post reviews directly from TortoiseHg. It is is available now in the current beta release of TortoiseHg 2.0.

It requires a slightly modified version of the Review Board Mercurial extension that can be downloaded here –

To use the dialog in TortoiseHg 2.0 you need to activate the above Review Board mercurial extension in the global mercurial settings file. Once activated, the Review Board dialog and menu items will be available in TortoiseHg 2.0.

You can set the Review Board extension settings in the TortoiseHg settings dialog under the Review Board tab. The Review Board server, username and password is required because the dialog will download a list of repositories and existing review requests from the server.

Once the settings are correct you are now ready to post a review to the Review Board server. To do so the user will need to select an outgoing change set or set of outgoing change sets from the TortoiseHg Workbench and click the right mouse button to bring up the context menu. From here you can select Post to Review Board that will open the Review Board dialog.

Within this dialog the user can set up the review that they are posting to the Review Board server. The user can choose to post a new review or update an existing review in addition to a list of the change sets that the user originally selected.

If the ‘outgoing’ option is not checked the review will contain the change sets between and equal to the top and bottom checked change set. For example if there are 5 change sets in the list and the first and last is not checked then the review will include change sets 2, 3 and 4 regardless if change set 3 is checked or not.

The Post and Update Review tabs have a set of fields and options dependant on the task chosen. In addition to these specialised options there are two options that relate to both that can be set.

1. Create diff with all outgoing change sets on this branch – This option will grey out the change sets box. The review will ignore what the user originally selected and will include all outgoing changes under this selected change set in the change sets list.
2. Publish immediately – This one is self explanatory, the review will not be posted as a draft.

Within the “Post Review” tab the user has two fields to complete/select.

1. Repository ID – A list of repository id’s that have been set up on the Review Board server
2. Summary – The summary of the review request that is being posted to Review Board. If this field is left blank then the summary will be set to the commit message of the first change set in the list

Within the “Update Review” tab the user has two fields to select.

1. Review ID – The review that the user wishes to update
2. Update fields of this existing request – The updated review will overwrite the current description in the existing review

Finally, once the user is happy with the options selected they can hit the Post Review button and the diff will be bundled up and posted to the Review Board server.

The review description will contain a list of the change sets posted and their commit messages.