3

I want a GUI to view, compare and checkout versions of my project(s). But when I want to install Tortoise HG, apt proposes to downgrade Mercurial. I remember that upgrading to 3.3 has solved some problem (I do not remember what it was), and I have a number of repositories created with 3.3, so I do not want to downgrade.

hg view sort of works, but it does not allow me to checkout a revision or compare two revisions with meld.

$ hg --version
Mercurial Distributed SCM (version 3.3.2)
...
$ sudo aptitude install tortoisehg
....
The following packages have unmet dependencies:
 tortoisehg : Depends: mercurial (< 3.2~) but 3.3.2-1ppa2~precise1 is installed.
The following actions will resolve these dependencies:

     Keep the following packages at their current version:
1)     tortoisehg [Not Installed]                         

Accept this solution? [Y/n/q/?] 

...

     Downgrade the following packages:                                                   
3)     mercurial [3.3.2-1ppa2~precise1 (now, precise) -> 2.0.2-1ubuntu1 (precise)]

So:

1. How do I install Tortoise-hg for Mercurial 3.3?

2. What alternatives can I use instead?

EDIT:

$ lsb_release -a; uname -a; apt-cache policy tortoisehg mercurial
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 12.04.5 LTS
Release:    12.04
Codename:   precise
Linux somename 3.11.0-26-generic #45~precise1-Ubuntu SMP Tue Jul 15 04:04:35 UTC 2014 i686 i686 i386 GNU/Linux
tortoisehg:
  Installed: (none)
  Candidate: 3.0-0ppa1~precise1
  Version table:
     3.0-0ppa1~precise1 0
    500 http://ppa.launchpad.net/tortoisehg-ppa/releases/ubuntu/ precise/main i386 Packages
     2.2-1 0
    500 http://XX.archive.ubuntu.com/ubuntu/ precise/universe i386 Packages
    100 /var/lib/dpkg/status
mercurial:
  Installed: 3.3.2-1ppa2~precise1
  Candidate: 3.3.2-1ppa2~precise1
  Version table:
 *** 3.3.2-1ppa2~precise1 0
    500 http://ppa.launchpad.net/mercurial-ppa/releases/ubuntu/ precise/main i386 Packages
    100 /var/lib/dpkg/status
     3.0.1-0ppa1~precise1 0
    500 http://ppa.launchpad.net/tortoisehg-ppa/releases/ubuntu/ precise/main i386 Packages
     2.0.2-1ubuntu1.2 0
    500 http://XX.archive.ubuntu.com/ubuntu/ precise-updates/universe i386 Packages
    500 http://security.ubuntu.com/ubuntu/ precise-security/universe i386 Packages
     2.0.2-1ubuntu1 0
    500 http://XX.archive.ubuntu.com/ubuntu/ precise/universe i386 Packages

EDIT2:

$ apt-cache policy tortoisehg
tortoisehg:
  Installed: (none)
  Candidate: 3.3.3+2-426769dbcfe8-0ppa1~precise1
  Version table:
     3.3.3+2-426769dbcfe8-0ppa1~precise1 0
    500 http://ppa.launchpad.net/tortoisehg-ppa/stable-snapshots/ubuntu/ precise/main i386 Packages
     2.2-1 0
    500 http://XX.archive.ubuntu.com/ubuntu/ precise/universe i386 Packages
    100 /var/lib/dpkg/status
  • [Edit] your question and add the output of lsb_release -a; uname -a; apt-cache policy tortoisehg mercurial – A.B. Nov 25 '15 at 12:52
  • Sorry, I have deleted my answer. None of the tortoisehg PPAs here works with mercurial 3.3.2. The snapshot PPA needs mercurial (>= 2.7~), mercurial (<< 2.9~) and the stable-snapshots PPA needs mercurial (>= 3.0~), mercurial (<< 3.2~). At least for Precise. – A.B. Nov 25 '15 at 14:46
  • You could force the installation, but I do not know if the idea is so good. – A.B. Nov 25 '15 at 14:48
  • Can I borrow a .deb from another distribution, say, Trusty? – 18446744073709551615 Nov 25 '15 at 14:55
  • I'm not sure. You can try it. It will not break your system. – A.B. Nov 25 '15 at 14:58
  • Well, after sudo apt-get download tortoisehg (download to the current directory) and sudo dpkg -i tortoisehg_3.3.3+2-426769dbcfe8-0ppa1~precise1_all.deb it works... Just not sure for how long it will work, I remember a package installed like this broke with the updates. – 18446744073709551615 Nov 25 '15 at 15:04
  • Please undelete the answer, I used your PPAs! – 18446744073709551615 Nov 25 '15 at 15:13
  • Undeleted, but with another content and a link to the old version. – A.B. Nov 25 '15 at 15:21

3 Answers3

2

After a few more in-depth investigations, I have found that the first version of my answer was wrong.

None of the “TortoiseHg PPA Packagers” team PPAs work with the Mercurial PPAs of the same team, at least not for Precise.

The TortoiseHg PPA Packagers: Snapshots PPA needs mercurial (>= 2.7~) and mercurial (<< 2.9~) and the TortoiseHg PPA Packagers: Stable Snapshots PPA needs mercurial (>= 3.0~) and mercurial (<< 3.2~).

A.B.
  • 90,397
1

Since tortoisehg-ppa is empty now, I ended up building the .deb packages from xenial. But tortoisehg from xenial is 3.7.3 and requires mercurial < 3.8, so you can't use mercurial-ppa which has 3.8.3. So build mercurial from xenial as well.

First install tools for building and update source repos:

sudo apt-get install dpkg-dev build-essential fakeroot

edit /etc/apt/sources.list and replace
  deb-src ... trusty universe
with
  deb-src ... xenial universe

sudo apt-get update

Build mercurial:

mkdir build-mercurial
cd build-mercurial
sudo apt-get build-dep mercurial
apt-get source mercurial
cd mercurial-3.7.3/
DEB_BUILD_OPTIONS=nocheck fakeroot debian/rules binary
sudo dpkg -i ../mercurial_*.deb

Build tortoisehg:

cd ../..
mkdir build-tortoisehg
cd build-tortoisehg
sudo apt-get build-dep tortoisehg
apt-get source tortoisehg
cd tortoisehg-3.7.3/
fakeroot debian/rules binary
sudo dpkg -i ../tortoisehg_*.deb

Note that dpkg may complain about uninstalled dependencies. Install them using apt-get install as needed and re-run dpkg -i ... .

patraulea
  • 681
0

First, I did as the first version of A.B.'s answer suggested:

sudo apt-add-repository ppa:tortoisehg-ppa/stable-snapshots
sudo apt-get update
sudo apt-get install tortoisehg-nautilus tortoisehg

but this was not enough (the last command failed).

Then I did

$ sudo apt-get download tortoisehg
Get:1 Downloading tortoisehg 3.3.3+2-426769dbcfe8-0ppa1~precise1 [4,090 kB]
Fetched 4,090 kB in 0s (5,018 kB/s) 

(it downloads a .deb to the current directory, the file date is Apr 3 2015 rather than the current date, and the full file name is not printed to the console) and after

sudo dpkg -i tortoisehg_3.3.3+2-426769dbcfe8-0ppa1~precise1_all.deb

it started to work for me. (No idea why --force-all (link) was not required.) In general, such installation is incorrect, but it happens to perform the most common functionality; the fact that it so far works on my system is no guarantee that it will work on your system in the future.

Note that apt-get and update-manager will try to "correct" this configuration (that is, to break it) almost each time you use them. You will likely have to do what they suggest and reinstall tortoisehg after their job is done.