Week 2 - Project Management

Mercurial Setup

 

Step 1

Download and install Mercurial http://mercurial.selenic.com

Step 2

Download the two key files (academy and academy.pub)

Acquire the key files from your instructor and be sure that there is no ".txt" extension. Copy the key files into your /.ssh directory.

Step 3

Edit the config file in ~/.ssh

Create a file named config with your text editor. The file should contain the follwing text...

host fab.cba.mit.edu

port 485

Step 4

Change permissions on the academy key file

Using the following commands on the terminal line we need to change the permissions on the key file. This is done to keep the key private. We do this with the following command:

sudo chmod 600 ~/.ssh/academy

Step 5

Clone repository

Once you have created the directory where you would like to place the archive you are ready to clone. To clone we use the command:

hg clone -e "ssh -p 846 -i ~/.ssh/keys/academy" ssh://hg@fab.cba.mit.edu/academy Archive

If the process was successful and you have not received any error messages, you should see (in my case) the folder 'Archive' will now be populated

Step 6

Edit repository configuration file

Within your clone of the archive there is a folder named '.hg'. Navigate to this folder and we will be appending the file named 'hgrc'. Append with:

username = First Last <user@machine.domain>

ssh = ssh -i ~/.ssh/keys/academy -C

[extensions]

convert =

fetch =

[hooks]

changegroup = hg update >&2

Step 8

Add your directory and class page.

Create a new directory in the format "lastname.firstname" and add your complet class page, including images and css files.

Step 9

Add the file to version control, commit and push your changes.

Here are the most common commands that will be needed to push your updates and pull the lastest changes to the archive

hg pull

hg add

hg commit -m "write a comment that will help you and others know what you just commited"

hg push

Note:

◊ The install and setup of Mercurial was pretty straight forward. The only issue I came across was with the initial clone command. I had the wrong folder listed for my keys. With an adjustment to ~/.ssh/keys/academy I was all set.

◊ This tutorial is based on http://academy.cba.mit.edu/2011/labs/urbana/mercedes.mane/Website/Tutorials/Mercurial_tutorial_Mac.html http://fab.cba.mit.edu/classes/MIT/863.10/people/natalie.freed/Mercurial_notes_notes.html