I\'m trying to use the hg-git Mercurial extension on Windows (Windows 7 64-bit, to be specific). I have Mercurial and Git installed. I have Python 2.5 (32-bit) installed.
<I found a simpler solution at http://candidcode.com/2010/01/12/a-guide-to-converting-from-mercurial-hg-to-git-on-a-windows-client/
And then I found a yet simpler solution myself:
To use the hg-git Mercurial extension on Windows:
[extensions]
hgext.bookmarks=
hggit=
To have SSH support you need plink.exe from PuTTY family. After that you should add the following to Mercurial.ini:
[ui]
username = John Doe <foo@example.com>
ssh=d:/home/lib/dll/plink.exe -i "d:/home2/ssh-private-key.ppk"
When connecting to a SSH server for the first time, you should start putty.exe and try to connect using it. It will add the server key fingerprint to the registry. Otherwise plink will ask you to accept the fingerprint but it doesn't accept any input.
You can use puttygen.exe to generate private keys. Either use keys without a passphrase or use Pageant.exe ssh authentication agent.
If you can install TortoiseHg, it includes dulwich and other requirements.
I got this error as well even after downloading the latest Tortoisehg and making sure the hggit plugin was installed as well as my .ini & hgrc files had the right entry to enable hggit.
Turns out my problem was that I had both mercurial and tortoisehg in my path. So when I ran any hg commands, it was using the hg.exe in mercurial folder as opposed to the hg.exe in the torsoisehg directory.
This makes sense but my mercurial installation did not have the plug ins. My fix was to remove mercurial from my path so hg commands go through the tortoisehg directory since it has hg completely bundled. Note however, the recommended option might be to upgrade mercurual to a version that has the plugins that one needs but this is what worked for me. I tried replacing the library.zip in mercurial with the one in tortoisehg and this worked but it led to other errors as one would imagine.
@techtonik's answer led me down this road for which I am grateful.
Recap: verify which hg exe is running your hg commands by checking your path because that hg.exe does not find the plugins for whatever reason.
I ran into this problem too with dulwich.errors. Instead of installing everything from scratch. I just copied dulwich from my default site-packages to the mercurial site-packages. worked with no problems.
sudo apt-get install python-dev # Dam you dependency!
sudo easy_install dulwich
Success!
Based on techtonik's explanation of the reason for the failing import of dulwich.errors
, I found a solution which appears simpler to me than the already proposed ones:
On the Mercurial download page there is offered
Mercurial
<x.y.z>
for Python 2.7 on Windows x86 (source install)
and
Mercurial
<x.y.z>
for Python 2.7 on Windows x64 (source install)
as .EXE files which install Mercurial as a Python module into an existing Python 2.7 (x86 or x64) installation.
If hg-git and dulwich have been installed to this Python installation as well, the import errors should vanish.
If you are not sure what to do now, I hope this step-by-step explanation helps:
<python 2.7 install dir>
and <python 2.7 install dir>\Scripts
are in the PATH
environment variable Now hg clone <some git repo>
should work on the console.