Installing hg-git on Windows 7, using MinGW to Compile

1k Views Asked by At

I'm trying to follow the directions at https://gist.github.com/1059280#comments for installing hg-git on Win7 with MinGW for compiling (from reading across StackOverflow and elsewhere, it seems that the only bit that needs to be compiled is the dulwich package [git for Python bindings of some sort, I gather.])

I'm using Python27 even though the directions on that site point towards Python26, which I suppose could be the issue.

I'm reluctant to download Visual C++ just for this issue.

I get to the following directions:

Create an import library for MinGW gcc (http://mercurial.selenic.com/wiki/BuildingOnWindows)

> cd c:\python27\libs
> pexports c:\windows\system32\python27.dll > python26.def

and get the following traceback:

PS C:\python27\libs> pexports c:\windows\system32\python27.dll > python27.def
stat: No such file or directory
c:\mingw\bin\pexports.exe: c:\windows\system32\python27.dll: could not load PE image

Python27.dll exists. A "stat" command does not.

Any ideas would be great, thanks.

1

There are 1 best solutions below

6
On

If your main goal is to have a working Hg-Git on Windows, the installation procedure I recommend is:

  1. Install TortoiseHg, which comes with dulwich pre-compiled
  2. Use TortoiseHg (either GUI or command-line) to clone https://bitbucket.org/durin42/hg-git to a directory (for now, I'll call it c:\hg-git) and update to a tagged version (such as Hg-Git 0.3.4 for TortoiseHg 2.6).
  3. Edit your Mercurial.ini/.hgrc file (or per-repository hgrc file) to enable the extension

The required configuration block looks something like this:

[extensions]
hggit=c:\hg-git\hggit

If you're using TortoiseHg 1.x.x, you'll also need to enable the bookmark extension, either in your configuration file or using the GUI (TortoiseHG - Global Settings - Extensions).

This topic was somewhat recently discussed on the Hg-Git mailing list: https://groups.google.com/d/topic/hg-git/lLHsYbxcTzI/discussion

TortoiseHg documentation on how to install Hg-Git (the important part is the bundled dulwich): https://tortoisehg.bitbucket.io/manual/2.5/nonhg.html#hg-git-git

The version of dulwich included in TortoiseHg can be derived from the contents of extension-versions.txt in the TortoiseHg installation directory. It identifies the revision in a Bitbucket repository that was shipped. For example, TortoiseHg 2.6 ships with dulwich hash 71b73697d24b, which from here is tagged as dulwich 0.8.5.