Hacking TortoiseHg on Windows
To be able to evaluate, test, or hack on TortoiseHg on Windows, you need to install:
- TortoiseHg binary installer (for shell extension and bootstrap) download
- Python 2.7.x (add
C:\Python27to your path after instalation)
- Mercurial 1.8 or later Python source package download mercurial-1.8.win32-py2.6.exe or https://bitbucket.org/tortoisehg/files/downloads/mercurial-3.1.1.win32-py2.7.exe
- PyQt >= 4.8.6, includes Qt and QSci download PyQt4-*-gpl-Py2.7-*.exe
- Clone the TortoiseHg source repo:
hg clone http://bitbucket.org/tortoisehg/thg thg
Once all of that is in place, you should be able to cd into the clone and start the Workbench with:
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.
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 are optional and require setuptools from http://pypi.python.org/pypi/setuptools#windows
- iniparse >= 0.3.1 (allows you to edit configuration files -
- pygments (allows the commit tool to offer variable completions -
For URLs and other helpful info, see:
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.