Wiki

Clone wiki

thg / developers / Windows

Hacking TortoiseHg on Windows

To be able to evaluate, test, or hack on TortoiseHg on Windows, you need to install:

Once all of that is in place, you should be able to cd into the clone and start the Workbench with:

python thg

To see the list of commands available, use python thg --help

Depending on where you put the content of all those packages, you might or might not be able to execute 'python thg' with success. There is a rather simple solution for that. Just create a thg.cmd file with the following content, and put in the same folder as the thg source file in your TortoiseHg source install. (It was originally provided by Adrian Buehlmann I think, in the early weeks of the Qt port.)

@echo off
::
:: thg.cmd
::
setlocal
::set LANG=nl
set HGPATH=M:\DEV\hg-default
set CMDPATH=C:\DEV\thg-qt-work
set PYTHONPATH=%CMDPATH%;%PYTHONPATH%
set PYTHONOPTIMIZE=1
set Path=%CMDPATH%;%Path%
echo --- running thg from %CMDPATH%
python "%CMDPATH%\thg" %*
:: set THGDEBUG=1
:: python "%CMDPATH%\thg" --nofork %*
endlocal

Just adapt any paths to your situation. You could even use it in a shortcut for running the Workbench from source f.i., with the command <drive>:\path\to\thg-src-repo\thg.cmd workbench, and <drive>:\path\to\thg-src-repo as the 'Start in' folder.

64bit

If it is your preference, you can download and install the 64bit Python, Mercurial, PyQt, pywin32, etc and run TortoiseHg as a 64 bit application. In fact, you can have both 32bit and 64bit packages installed at the same time. Except for the TortoiseHg binary installer, you must install the x64 package on an x64 O/S because of the shell extension.

Extras

Extras are optional and require setuptools from http://pypi.python.org/pypi/setuptools#windows

  • iniparse >= 0.3.1 (allows you to edit configuration files - c:\Python26\Scripts\easy_install.exe iniparse)
  • pygments (allows the commit tool to offer variable completions - c:\Python26\Scripts\easy_install.exe pygments)

For URLs and other helpful info, see:

http://bitbucket.org/tortoisehg/thg-winbuild/src/tip/README.txt

FAQ

I get Cannot mix incompatible Qt library (version 0×40701) with this library (version 0×40702) after source install. What to do?

As described in Qt Project just restart your cmd window. PATH is probably not updated and you have some conflicts.

Updated