TortoiseHg (Mercurial) can not find hggit extension
Asked Answered
M

1

8

I'm trying to get the hg-git extension to work with TortoiseHg (v5.8 on Win10). I have enabled the "hggit" extension in the settings. But when I try to push to github I get an error:

*** failed to import extension hggit: No module named hggit

Searching my drives I only have on hg executable in the TortoiseHg directory but can not find any hggit or hg-git binaries. Is there something else one have to do to get the extension working?

Monaghan answered 6/6, 2021 at 12:23 Comment(2)
Just to check, did you follow the installation instructions on mercurial-scm.org/wiki/HgGit or at least something similar?Footcandle
@Footcandle I have not yet attempted to install hggit manually as if I'm not misunderstanding TortoriseHg should manage that itself when selecting hggit (as otherwise I believe one has to manually update the bundled python libraries with the mercurial python used by TortoiseHg)?Monaghan
F
8

UPDATE - a beta release of THG 6.1.2 apparently has restored hggit and is available now:

https://foss.heptapod.net/mercurial/tortoisehg/thg/-/issues/5752#note_185806

I haven't tried it yet myself.

That post also notes:

The plan is for a py3 installer to be available with the next major release [in July 2022]


Original answer:

Apparently at the moment THG has the option to include hggit in the settings, but does not actually package hggit itself.

According to Matt Harbison, one of the contributors/maintainers of TortoiseHG:

I took [hggit] out because it was always lagging behind changes in core hg, and its dependencies broke stuff.

He goes on to add:

install by simply running py -2 -m pip install hg-git --user if you have python2 installed on your system.

Another person (Aurélien Campéas) states the following for using Python 3:

with python 3 and a plain "pip install mercurial hg-git" and it just works


Further, this other post by Keith Turkowski describes a full installation of THG and hggit with Python3 on Windows:

  • Install python-3.9.2-amd64.exe (if you want to use Python 3 and have Python.exe in the path)

  • Install putty-0.74-installer.msi (for SSH support)

  • Install tortoisehg-5.7.0-x64.msi

  • Install python-2.7.18.amd64.msi (For current user, Python.exe not in path)

  • Win+R -> cmd (command prompt): py -2 -m pip install hg-git --user

  • Enable hggit in TortoiseHg Settings (Extensions)

I assume you could use newer versions of the THG, Python, etc. installers.

Footcandle answered 20/6, 2021 at 11:41 Comment(2)
If it's disabled fair enough, although I'm a little curious why there's setting for it in TortoiseHGPoinsettia
@Poinsettia apparently it used to work from THG, but they later removed it from the installer yet left the option in the GUI. Since THG and HG are fairly decoupled (the settings screen in THG just updates the mercurial INI file) this actually makes sense, and it seems possible to install hggit independantly in which case the GUI option should still function normally.Footcandle

© 2022 - 2024 — McMap. All rights reserved.