如何在 Ubuntu MATE 20.04 LTS 上安装与 Caja 集成的 TortoiseHG?

N0r*_*ert 7 mercurial mate caja ubuntu-mate 20.04

在 Ubuntu 16.04 LTS 和 18.04 LTS 等以前的系统上,这是可能的。

但是 20.04 LTS在存储库中没有tortoisehg和。tortoisehg-caja

该怎么办?

N0r*_*ert 9

它仍然是可能的,但是通过手动安装软件包。

基于从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
Run Code Online (Sandbox Code Playgroud)

然后用caja -q && caja.

因此,您将在 Caja 中使用 TortoiseHG 前端获得 Mercurial 的全部功能:

  • 相同的标志

    Caja 与 TortoiseHG 集成 - 标志

  • 和下拉菜单

    与 TortoiseHG 集成的 Caja - 菜单


笔记:

  1. 20201019 - Ubuntu 20.10 存储库提供基于 python3 的 Mercurial 包。
  2. Ubuntu 20.10 有需要的包,所以我们可以替换第 1 步sudo apt-get install mercurial,然后继续下一步。我已经在 Ubuntu MATE 20.10 上测试了这个方法。它运作良好!