Skip navigation
The Australian National University

Laboratory 6 - Version Control with Mercurial

Aim

The aim of this lab is to introduce you to the advantages of using version control systems.

Preparation

Please go through the configuration management and version control slides for lecture 21. As well, you should read the wikipedia page on version control.

In this exercise we will use the Mercurial distributed version control system to demonstrate the advantages of using version control in your daily work.

Rather than developing a new tutorial, we have chosen to use one of the many good tutorials available on the web. Specifically we have chosen to use part of a Mecurial tutorial developed by Joel Spolsky.

Tools

All of the tools required to complete this lab are installed on Linux-based computers in the Computer Science labs.

Instructions

  1. Before we start the tutorial itself, we need to create a directory which contains some files we can play with using Mercurial. So download the file engn2219_lab6.tgz to a convenient directory and use the following command to extract its contents:
    tar xvzf engn2219_lab6.tgz
    This will create a new directory called engn2219_lab6 in the current directory. We will complete the tutorial in this directory.
  2. Open a browser and go to Spolsky's Mercurial Tutorial. On the home page you will see icons representing six stages of the complete tutorial. We will focus on the second section.
  3. Click on the second section of the tutorial (Ground Up Mercurial).
  4. You will note that the tutorial is written for Windows users. This should not present any of you with a problem as Mercurial commands are the same on Windows, MacOS, Unix and Linux (by the way, why do you think Mercurial command lines begin with the command hg?).

    For those who are a little rusty on Windows or Linux, the following table lists Windows commands and their Linux equivalent.

    WindowsLinux
    cdcd
    copycp
    delrm
    dir/wls -a
    typecat

  5. Begin the tutorial, noting the following:

    1. Your working directory will be engn2219_lab6 rather than CountDown.
    2. Your working directory will contain a different set of files to those in the tutorial. However, specific files mentioned in the tutorial are in your working directory.
    3. When you do your first hg commit you may be asked to choose a text editor to enter comments. Choose the recommended nano editor if you are unsure.
  6. If you have time after completing the above tutorial, you could do either or both of the following:

    1. Take a look at the third section of Spolsky's tutorial (Setting up for a Team)
    2. Place some of your own files under version control using Mercurial.

Updated:  Fri Jun 14 14:28:31 EST 2013 / Responsible Officer:   JavaScript must be enabled to display this email address. / Page Contact:   JavaScript must be enabled to display this email address.