Follow

Installing Mercurial

  • Applies to: Grid
    • Difficulty: Medium
    • Time Needed: 20
    • Tools Required: SSH, vi knowledge
  • Applies to: DV
    • Difficulty: Medium
    • Time Needed: 30
    • Tools Required: SSH, root, vi knowledge

Overview

Mercurial is a fast, lightweight Source Control Management system designed for efficient handling of very large distributed projects, similar to other 'versioning' tools such as subversion and git.  Please consult Mercurial's official website for further information.

READ ME FIRST

This article has the following dependencies:

  • Whenever installing third-party software, please consult the official documentation. (mt) Media Temple does not support the installation and configuration of software not installed at time of service activation. Please consult our Grid Scope of Support page for further explanation.
  • The domain example.com is used as an example. Please be sure to replace this text with the proper information for your site or server.
  • This article assumes that you have already set up git locally on your own computer. Due to the diversity of desktop computer platforms, this article does not cover the steps to get it set up locally.
  • You should also be familiar with connecting via SSH to your server.
  • The commands shown here are included as examples only. Ensure you are installing the most recent version by referring to the software maker's website.

Instructions

  1. Log into your Grid using SSH and change to the data directory by executing:
    cd data 
  2. Download the latest version of Mercurial. You can find this version by going to their latest releases page. To download directly to the data directory, use the wget command, replacing the version shown below with the current version as seen on their website:
    wget http://www.selenic.com/mercurial/release/mercurial-*.tar.gz  
  3. Extract the files using the tar command and change into the directory:
    tar xzvf mercurial-*.tar.gz  

    cd mercurial-*   
  4. Install the Mercurial files into your home directory located at ~/bin and ~/lib using the following command inside the mercurial directory:
    make install-home   
  5. Add the following lines to the bottom of your ~/.bash_profile file. If the file does not exist, create it:
    export PYTHONPATH=${HOME}/lib/python:$PYTHONPATH
    export PATH=${HOME}/bin:$PATH 

    This command will add those lines for you:

    echo -e 'export PYTHONPATH=${HOME}/lib/python:$PYTHONPATH\nexport PATH=${HOME}/bin:$PATH' >> ~/.bash_profile 
  6. You must now refresh your environment variables for your shell session to register the new settings. This has to be done only once. Type the following:
    source ~/.bash_profile  
  7. Mercurial should now be installed on your Grid. You can test this by running:
    hg debuginstall
  8. To add a username to remove the No username found message, type the following replacing it with your name and email:
    echo -e '[ui]\nusername = John Doe <john@example.com>' >> ~/.hgrc
  9. Your output after correcting the username error should be similar to:
    example.com@cl25:~/data/mercurial-1.2.1$ hg debuginstall Checking encoding (ascii)...
    Checking extensions...
    Checking templates...
    Checking patch...
    Checking commit editor...
    Checking username...
    No problems detected 

Resources

Overview

Mercurial is a fast, lightweight Source Control Management system designed for efficient handling of very large distributed projects, similar to other 'versioning' tools such as subversion and git.  Please consult Mercurial's official website for further information.

STATEMENT OF SUPPORT:
Please keep in mind that troubleshooting the configuration/functionality of third-party applications is not covered by our statement of support. These resources were provided as a courtesy to assist you to the extent of our abilities. For more information on our statement of support, feel free to click here.

The commands shown here are included as examples only. Ensure you are installing the most recent version by referring to the software maker's website.

Steps

  1. SSH into your server as the root user.
  2. Create a temporary folder
    mkdir rpm-download
  3. Move into that directory
    cd rpm-download
  4. Download the latest x86_64 RPMforge package for CentOS 5, using the wget command:
    wget http://packages.sw.be/rpmforge-release/rpmforge-release-*.el5.rf.x86_64.rpm
  5. Add this repository to our search set:
    rpm -Uvh rpmforge-release-*.el5.rf.x86_64.rpm
  6. Install Mercurial:
    yum install mercurial
  7. Make sure it worked
    hg
  8. Remove temporary folder
    cd ..
    rm -r rpm-download

    NOTE:

    You can skip the first command (cd) if you are not in the temporary folder.

Was this article helpful?
0 out of 0 found this helpful

Comments