Clone wiki

hgtk / SVN

TortoiseHg for SVN Users

This page is intended as a compendium of links and helpful notes for Subversion users who are converting to, or at least trying out, Mercurial and TortoiseHg.

When learning Mercurial the first stop should be the hgbook, available in html. Mercurial's wiki is also a key source.

Using TortoiseHg with a Subversion like work flow

As you first begin using TortoiseHg, you may want to configure some of these optional features to approach a more subversion like work flow. See the settings tool manual to learn how to configure these settings either globally or per-repository.

Post-Pull Operations

After changesets are pulled from a remote repository, TortoiseHg can perform an automated function. In the settings tool, this option can be found at the top of the Sync tab.

  1. Update - checkout the new tip changeset on your current branch. If you have uncommitted changes, this can result in a three way merge if changes in the new tip conflict with your changes (rare, but possible).
  2. Fetch - automatically merge your local changesets with the pulled changesets. Requires the fetch extension to be enabled. Does not perform any merge if your repository has uncommitted changes.
  3. Rebase - automatically rebase your local changesets onto the top of the pulled changesets. Requires the rebase extension to be enabled. Does not perform a rebase if your repository has uncommitted changes.

This setting can also be changed on the fly in the Repository Explorer before you perform a pull, in case you want to change your default behavior for a single operation.

Post-Commit Push

This setting can be found on the commit tab of the settings tool. When enabled, TortoiseHg will attempt to push your local changesets to your default upstream repository after every successful commit.


By default, TortoiseHg will use kdiff3 (a graphical three way merge tool) to resolve merge conflicts. You have a number of other options. On the TortoiseHg tab of the settings tool, you will find a 'Three-way Merge Tool' configurable.

  1. If you have TortoiseSVN installed and prefer TortoiseMerge you can select TortoiseMerge from the drop-down list.
  2. If you prefer P4Merge, or some other tool supported by Mercurial, it will automatically show up in the drop-down list.
  3. If you want Mercurial to write the .BASE .LOCAL .OTHER versions for you to manually merge, chose internal:dump
  4. If you want Mercurial to prompt you whether to keep either the local or other version, chose internal:prompt
  5. If you want Mercurial to perform trivial merges internally, and leave conflict markers in place on conflicts, chose internal:merge

See merge-tools for a description of how to configure an external merge tool that was not supported "out of the box."

Using TortoiseHg as a client for a Subversion server

hgsubversion should work with TortoiseHg "out of the box", since TortoiseHg Windows installers include the SVN python bindings required by hgsubversion. Simply clone the extension to your machine, enable it, read its documentation. then clone your subversion repository.

mkdir C:\repos
hg clone C:\repos\hgsubversion

Add lines like these to your Mercurial.ini file

hgsubversion = C:\repos\hgsubversion

Make a test clone:

hg clone svn+ python-hg

See also