3

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.

urbushey
  • 1,339
  • 1
  • 13
  • 21

1 Answers1

4

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.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
davidmc24
  • 2,232
  • 1
  • 19
  • 17
  • I think, idea "update to master" was just mistake, not sabotage: master bookmark is outdated (2012-09-05 23:27:31 -0400 (2 months)), tip or latest tag will be better choice – Lazy Badger Nov 23 '12 at 02:04
  • It wasn't a mistake. What I was trying to indicate is that the "next" bookmark (which is usually what tip refers to these days) is not what users would want for these instructions, as it currently depends on an unreleased version of dulwich (which thus isn't bundled with TortoiseHg). I'll update the answer to try to clarify that. – davidmc24 Nov 23 '12 at 02:16
  • In TortoiseHg 2.0 or later, it shouldn't be necessary to enable the bookmark extension, as bookmarks have been part of Mercurial core since 1.8. The GUI in TortoiseHg 2.6 (and at least some previous versions) doesn't include a checkbox for the bookmark extension. – davidmc24 Nov 23 '12 at 02:54
  • As for using hg-git "next" with less than dulwich 0.8.6, some things will work, but others (in particular, repositories using git submodules) will break, as it's not a supported version. Try "hg clone git://github.com/kollerma/serie1.git". You'll get a traceback ending in: "AttributeError: 'ConfigFile' object has no attribute 'keys'" – davidmc24 Nov 23 '12 at 03:10
  • Forgot about bookmark integration, sorry. Is this revision better? For using latest tags - I haven't complains for this revision of text (yes, tip gave me traceback, 0.3.4 - doesn't) – Lazy Badger Nov 23 '12 at 04:57
  • @LazyBadger: Adding the caveat that it only applies to 1.x.x makes it much better. I tweaked it a little to make that caveat more visible by moving it to the start of the sentence. – davidmc24 Nov 23 '12 at 05:15