Ubuntu – How to install TortoiseHG with integration to Caja on Ubuntu MATE 20.04 LTS

20.04cajamatemercurialubuntu-mate

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?

Best Answer

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 http://archive.ubuntu.com/ubuntu/pool/universe/m/mercurial/mercurial-common_5.5.1-1_all.deb
wget http://archive.ubuntu.com/ubuntu/pool/universe/m/mercurial/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!