Skip to content

Instantly share code, notes, and snippets.

@VioletGiraffe
Forked from adduc/install.sh
Last active March 10, 2024 17:23
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save VioletGiraffe/166b62c4e170174976ee7691431c25e6 to your computer and use it in GitHub Desktop.
Save VioletGiraffe/166b62c4e170174976ee7691431c25e6 to your computer and use it in GitHub Desktop.
My installation of tortoisehg on Ubuntu 20.04 and newer
#!/bin/bash
TARGET_DIR=~/Downloads/repos/third-parties
TORTOISEHG_VERSION=${5:-stable}
prepare() {
sudo apt-get -y update
sudo apt-get -y install \
curl \
gcc \
make \
mercurial \
python-is-python3 \
python3 \
python3-dev \
python3-distutils \
python3-docutils \
python3-dulwich \
python3-iniparse \
python3-pip \
libxcb-xinerama0
pip3 install PyQt5 QScintilla mercurial
mkdir -p ${TARGET_DIR}
}
install_tortoisehg() {
echo 'Starting install_tortoisehg'
cd ${TARGET_DIR}
rm -rf thg || true
rm /usr/local/bin/thg || true
hg clone -u ${TORTOISEHG_VERSION} https://foss.heptapod.net/mercurial/tortoisehg/thg
sudo mkdir /usr/local/bin/ || true
sudo ln -fs ${TARGET_DIR}/thg/thg /usr/local/bin/thg
}
main() {
set -xe
prepare
install_tortoisehg
}
main
@nyamatongwe
Copy link

Thanks, that worked for me.

@FoxNeo
Copy link

FoxNeo commented May 1, 2021

This still working. Thanks!

@FoxNeo
Copy link

FoxNeo commented May 1, 2021

To create a desktop application open /usr/share/applications/ and create a file tortoiseHG.desktop:

[Desktop Entry]
Name=tortoiseHg
GenericName=Version Control GUI
Icon=TortoiseHG_logo
Comment=Mercurial GUI Client
Exec=thg --nofork
Terminal=false
Type=Application
Encoding=UTF-8
Categories=Development;RevisionControl;
Keywords=thg;hgtk;mercurial;vcs

@VioletGiraffe
Copy link
Author

Thank you!

@federicoemartinez
Copy link

I had to also run
sudo apt-get install libxcb-xinerama0
because if not I got a Qt error:


qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl, xcb.

@VioletGiraffe
Copy link
Author

VioletGiraffe commented Dec 10, 2021

Getting this error on Ubuntu 21.01, any ideas how to fix it and what's wrong?

ImportError: cannot import name 'urlutil' from 'mercurial.utils' (/usr/lib/python3/dist-packages/mercurial/utils/__init__.py)

P. S. It's finally available simply via apt install tortoisehg on 21.10!

@Q0
Copy link

Q0 commented Apr 6, 2022

I had to also run sudo apt-get install libxcb-xinerama0 because if not I got a Qt error:


qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl, xcb.

Use

sudo apt-get install '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev

@AndryRazanadrakoto
Copy link

hello need help please
./thg
Traceback (most recent call last):
File "/home//Downloads/repos/third-parties/thg/./thg", line 163, in
tortoisehg.hgqt.run.run()
File "/usr/lib/python3.10/importlib/util.py", line 247, in getattribute
self.spec.loader.exec_module(self)
File "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "/home/
/Downloads/repos/third-parties/thg/tortoisehg/hgqt/run.py", line 47, in
from ..util.i18n import agettext as _
ImportError: cannot import name 'agettext' from 'tortoisehg.util.i18n' (/home/***/Downloads/repos/third-parties/thg/tortoisehg/util/i18n.py)

@VioletGiraffe
Copy link
Author

VioletGiraffe commented Mar 10, 2024

hello need help please

Hello, what OS are you running? Ubuntu 22.04 has tortoisehg in apt so you can just install it hassle-free. I haven't used this script in years because it's no longer needed.

@AndryRazanadrakoto
Copy link

I Use Ubuntu 22.04, Yes I try snap, apt, and it's the same error

@VioletGiraffe
Copy link
Author

sudo apt install tortoisehg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment