tortoisehg / stable (http://tortoisehg.bitbucket.org/)

TortoiseHg repository. Main line of development in "default" branch. Releases, bugfixes, and documentation improvements in "stable" branch.

Clone this repository (size: 23.9 MB): HTTPS / SSH
$ hg clone http://bitbucket.org/tortoisehg/stable/

TortoiseHg FAQ

What is TortoiseHg?

A Windows shell extension for the Mercurial revision control system, similar to the Tortoise clients for Subversion and CVS. It also includes an hgtk application for command line use on many platforms.

What comes included in the TortoiseHg binary installer for Windows?

  • Mercurial
  • kdiff3
  • TortoisePlink
  • bonus extensions: hgfold, hgcr-gui, mercurial-keyring, perfarce
  • Subversion Python bindings, for use by hgsubversion and convert extensions
  • Dulwich, for use by hg-git
  • Python Keyring, for use by mercurial-keyring

My repository is corrupted, help!

Please read the mercurial wiki page "Dealing With Repository And Dirstate Corruption" for recommendations on what to do.

Several on-access virus scanners (e.g. Avira, AVG) have been reported to cause problems because they lock files at random times while scanning, causing mercurial to abort when it tries to update or delete files locked by the scanner. This is especially true for files inside mercurial's internal data structures inside the .hg dir.

How can I get translations for the Explorer context menu?

See the Download wiki page

How do I do merges and arbitrary version checkouts in 0.8?

Merges and updates intended to be done from within the Changelog tool ('Repository Explorer' menu option) in 0.8.

How do I get menu icons on GNOME/Linux?

Recent Ubuntu releases default to menu icons disabled. You can enable them via: System -> Preferences -> Appearence. On the 'Interface' tab, turn on 'Show icons in menus'

How do I fix 'failed to import extension hgext.hgconfig...' warnings?

Upgrading to release 0.7.2 or later should fix these warnings, but there are further complications on Vista. See issue #135.

How can I use the hg-git extension with TortoiseHg

Releases since 0.9.3 have included the dulwich package, so all that is necessary is to clone hg-git and enable hg-git and bookmarks extensions.

[extensions]
hggit = C:\extensions\hg-git\hggit
bookmarks =

Beware the 'incoming' command appears broken when speaking with git repositories, and 'outgoing' does not show much useful info. So you are restricted to simple push and pull commands (not uncommon for extensions that speak with external revision control tools).

How can I use the hgsubversion extension with TortoiseHg

TortoiseHg installers include the svn Python bindings required by hgsubversion, so all one has to do is clone hgsubversion and then enable it.

[extensions]
hgsubversion = C:\extensions\hgsubversion\hgsubversion

How do I use TortoiseHg’s shelve extension from the hg command line?

Enable the extension in your Mercurial.ini file:

[extensions]
tortoisehg.util.hgshelve=

Why can't I connect to an ssh server (TortoisePlink.exe - "...cannot execute specified..." error message)?

Release 0.7.2 and later include a version of TortoisePlink that does not have extra library dependencies, so upgrading will probably fix this problem. See also ssh.

Can I use a different ssh client?

Yes, see ssh

Can I change the way toolbars are displayed?

TortoiseHg dialogs are PyGtk applications, so they can be configured by modifying the gtkrc file that is installed as gtk\etc\gtk-2.0\gtkrc under the installation folder.

gtk-toolbar-icon-size = GTK_ICON_SIZE_LARGE_TOOLBAR
# Pick an icon size from:
# GTK_ICON_SIZE_MENU
# GTK_ICON_SIZE_SMALL_TOOLBAR
# GTK_ICON_SIZE_LARGE_TOOLBAR   (default)
# GTK_ICON_SIZE_BUTTON
# GTK_ICON_SIZE_DND
# GTK_ICON_SIZE_DIALOG
gtk-toolbar-style = GTK_TOOLBAR_BOTH
# Pick a toolbar style from:
# GTK_TOOLBAR_ICONS
# GTK_TOOLBAR_TEXT
# GTK_TOOLBAR_BOTH              (default)
# GTK_TOOLBAR_BOTH_HORIZ

These settings are applied globally to all TortoiseHg applications.

How can I use WinMerge as my visual diff tool?

Add these lines to your personal Mercurial.ini file

[extdiff]
cmd.winmerge = C:\Program Files\WinMerge\WinMerge.exe
opts.winmerge = /e /x /ub /wl

Now run the Global Settings tool. On the TortoiseHg tab, you should see winmerge available in the drop-down list for Visual Diff Command. Select winmerge, apply, then close.

This same approach can be used to add nearly any visual diff tool, but be aware that your diff tool must be able to support directory diffs if it is to be used by TortoiseHg, unless you are using release 0.8 or later.

How can I use Araxis Merge as my visual diff tool?

Add these lines to your personal Mercurial.ini file

[extdiff]
cmd.araxis=C:\Program Files\Araxis\Araxis Merge v6.5\compare.exe
opts.araxis=/wait
[merge-tools]
araxis.executable=C:\Program Files\Araxis\Araxis Merge v6.5\AraxisP4WinMrg.exe
araxis.priority=1
araxis.args=$base $other $local $output
araxis.gui=True

Now run the Global Settings tool. On the TortoiseHg tab, you should see araxis available in the drop-down list for Visual Diff Command and araxis in the drop down list for Three-way Merge Tools. Select araxis for both options, then close.

I'm a CLI user, how do I disable the shell extensions (overlay icons and context menus)?

You can disable overlays via the taskbar options menu. The only way to disable the context menu is to rename ThgShell.dll in your install directory and then restart explorer (this completely disables the shell extension).

How is TortoiseHg configured?

TortoiseHg gets configuration settings from two systems.

  1. The Mercurial configuration system, which is three-tiered
    1. Site-wide Mercurial.ini in %ProgramFiles%\TortoiseHg
    2. Per-User Mercurial.ini in %UserProfile%
    3. Per-Repository Mercurial.ini in {repo-root}\.hg\hgrc
  2. %APPDATA%\Tortoisehg settings for application state (window positions, etc)

These are (some of the) configurables that are stored the Mercurial configuration system.

[tortoisehg]
extcommit = None
vdiff = vdiff
editor = gvim
tabwidth = 4
longsummary = True
copyhash = False
graphlimit = 500
authorcolor = True
authorcolor.steve = blue

Is it possible to change fonts?

In some cases, yes. The gtools based dialogs (commit, status, shelve) allow some font configuration.

[gtools]
# font used in changeset viewer and commit log text
fontcomment = courier 10
# font used for diffs in status and commit tools
fontdiff = courier 10
# font used in file lists in status and commit tools
fontlist = courier 9

# make the integrated diff window appear at the bottom or side
# (applies to commit and status dialogs)
diffbottom = False

How do I switch GTK themes?

In 0.7, the theme was selectable at install time. For other releases, (and after install on 0.7) you can still do this manually

  • cd C:\Program Files\TortoiseHg\share\themes (>=0.8, this is gtk\share\themes)
  • look at the themes in this directory, remember their names or keep this folder open.
  • cd ..\..\etc\gtk-2.0
  • edit gtkrc and change the name of the theme you wish to use
  • Vista may try to prevent you from editing the file directly. I work around this by copying to your desktop, editing it there, then copying it back (and answering all the security dialogs)
  • Changes immediately take affect on all newly launched applications

You also should be able to download new themes and copy them into the share\themes directory and then enable them in your gtkrc.

After uninstalling, it left a bunch of DLL and PYD files behind.

Reboot, like the uninstaller told you to :-) The uninstaller marked those files for removal at the next boot since most of them could not be removed while your system was running.

How can I convert a subversion repository to Mercurial?

You must install svn-win32-1.6 command line tools, then add them to your path. Then you must enable the convert extension. At this point, you should be able to use the 'hg convert' command to do the conversion. Please direct problems/questions about the convert extension to the Mercurial mailing list or #mercurial on irc.freenode.net.

You should also investigate the hgsubversion extension, which does not require svn command line tools.

Where do TortoiseHg extensions look for external Python modules on Windows?

TortoiseHg includes an entire Python distribution bundled up as DLLs. The standard library modules are all in the library.zip file in C:\Program Files\TortoiseHg.

If you try to use an extension that imports a non-standard Python module, you will find that the extension will fail to load because it can't find the module. For example the ReviewBoard extension imports the simplejson module, which is not part of the standard Python distribution.

In order to make it work you need to add a couple of lines to the top of the extension's .py file, before the line that imports the foreign module:

import sys
sys.path.append('C:\\path\\to\\module')

Note that this will not work for modules distributed as .egg files; the supplied path must contain the module's .py or .pyc files.

How do I fix odd characters in dialog?

In 0.8, we no longer distribute multiple themes and switched default theme to MS-Windows. As a result, it might causes an issue related default font of MS-Windows theme in some environments. In order to fix this issue, add following setting to TortoiseHg's 'gtkrc' file:

style "msw-default"
{
  font_name = "MS UI Gothic 9"
}

You can find gtkrc file in your TortoiseHg install directory:
i.e. C:\Program Files\TortoiseHg\gtk\etc\gtk-2.0\gtkrc