7

On previous systems like Ubuntu 16.04 LTS and 18.04 LTS it was possible.

But 20.04 LTS do not have tortoisehg and tortoisehg-caja in the repositories.

What to do?

N0rbert
  • 99,918

2 Answers2

9

It is still possible, but by manual installation of packages.

One can use the method below based on obtaining packages from Ubuntu 20.10:

# 1. Get the newest Mercurial with Python 3 support
cd ~/Downloads
wget https://launchpad.net/ubuntu/+source/mercurial/5.5.1-1/+build/19906561/+files/mercurial-common_5.5.1-1_all.deb
wget https://launchpad.net/ubuntu/+source/mercurial/5.5.1-1/+build/19906561/+files/mercurial_5.5.1-1_amd64.deb

2. Install Mercurial packages

sudo apt-get install ./mercurial*.deb -y

3. Get dependencies for TortoiseHg

sudo apt install python3-all-dev python3-pyqt5 python3-pyqt5.qsci python3-iniparse -y

4. Get sources of TortoiseHg

hg clone https://foss.heptapod.net/mercurial/tortoisehg/thg cd thg hg checkout 5.5.1

5. Compile TortoiseHg using Python 3

sudo apt-get install python-is-python3 make local sudo python3 setup.py install

6. Install TortoiseHg extension for Caja

mkdir -p ~/.local/share/caja-python/extensions cp /usr/local/share/nautilus-python/extensions/nautilus-thg.py ~/.local/share/caja-python/extensions/caja-thg.py

and then restart Caja with caja -q && caja.

As the result one will get full functionality of Mercurial with TortoiseHG front-end in Caja:

  • the same emblems

    Caja with TortoiseHG integrated - emblems

  • and dropdown menus

    Caja with TortoiseHG integrated - menus


Notes:

  1. 20201019 - Ubuntu 20.10 repositories provide python3-based Mercurial packages.
  2. Ubuntu 20.10 have needed packages, so we can replace step 1 by sudo apt-get install mercurial and then proceed with next steps. I have tested this method on Ubuntu MATE 20.10. It works well!
N0rbert
  • 99,918
  • If you have Ubuntu 20.04 or any other derived distribution (like Mint 20), then use exact version of Mercurial as in the answer - that is 5.5.1-1. I tried a newer version (5.6.1) and it didn't work, because it expects python 3.9 to be default on the system, but Ubuntu 20.04 has python 3.8.5, so the deb package has missing dependency and will not work without some additional tweaking. – Eiver May 28 '21 at 21:55
2

THANK YOU N0RBERT !!

One tweak to N0rbert's instructions: you may want to pull the "stable" branch of tortoise. As of today (6/2/2020) the "Shelf" feature is broken on main branch but is fixed in stable.

hg clone https://foss.heptapod.net/mercurial/tortoisehg/thg -r stable

(old: the command was: hg clone https://bitbucket.org/tortoisehg/thg/ -r stable but it looks like that is now gone.)

After you complete all of N0rbert's instrutions, if you'd like an easy way to launch Tortoise, create a .desktop file:

gedit ~/.local/share/applications/tortoisehg.desktop

And paste in these lines (replace "developer" with your username) :

[Desktop Entry]
Name=TortoiseHG
Exec=/home/developer/tortoisehg/thg
Comment=Launch TortoiseHG
Terminal=false
Type=Application
Icon=/home/developer/tortoisehg/icons/thg_logo.ico

Now you can click the start menu ("Show Applications"), search for Tortoise, right-click it and add to favorites.

Jay
  • 131