Mercurial (hg) Installation Without Being Root

Aus Open Source Ecology - Germany
Version vom 12. Januar 2014, 16:22 Uhr von Jan R.B.-Wein (Diskussion | Beiträge) (Work in progress!)
(Unterschied) ← Nächstältere Version | Aktuelle Version (Unterschied) | Nächstjüngere Version → (Unterschied)
Zur Navigation springen Zur Suche springen

Solutions for installing mercurial from a package repository or via a self-extracting or any other installer in any operating system distribution can easily be found.


With a Python installation readily available or with rights to install a python environment:

If a python installation is available or you have a server where you have adminsitrative rights for installing the python and still want to have a local installation of mercurial into your home directory, this also is no problem by using the Mercurial script: make install-home (to include documentation) or make install-home-bin (for the executable only). If you used a custom python location for the script it is required to add the following to the command to communicate it to hg: $ PYTHON=/path/to/python2.4-or-newer $ make install-home Source: http://mercurial.selenic.com/wiki/UnixInstall#Per-user_installation


Without Root access and no Python available:

To install mercurial without being root, needs us to bundle Python 2.x (as Python 3 is not yet supported as there is only one advantage in favour of upgrading, so it's not worth the effort currently).

Windows

For Windows there currently is PortablePython as a ready made option.

UNIX

For UNIX systems (Mac OS, GNU/Linux, Android, ...) or FreeBSD there are some packages floating around in the net, but it's sometimes hard to find the correct one for a certain architecture and operating system (what is needed to match the server's arch and os).

So if you have a system similar to the web server available where you have root access, the following is an option of how to get a working mercurial and python.

Virtual / bundled installation of Python

To create a virtual/bundled installation of Python and Mercurial there are two or more quite similar ways.

We will proceed in adapting this splendid blog entry of Fabrizio: https://weblogs.java.net/blog/fabriziogiudici/archive/2009/07/installing_merc.html .

For now it turned out that the blog post is no longer up to date as there will not be a binary for mercurial, namely 'python2/bin/hg' is missing.

To fix this:

$  tar -xvf mercurial_bundled_python.tar.gz 
$ cd mercurial_bundled_python/
$ make install-home-bin
$ hg                   # should show version

or

$ make local      # build for inplace usage
$ ./hg --version  # should show the latest version