Using Mercurial on Mac OS 10.5 Leopard

The source code management system we are using in my project is Mercurial. To learn more about using Mercurial, see the information in the "UnderstandingMercurial" and "Tutorial" guides in the "Getting Started" section on the main Mercurial page. There is also a more extensive manual available.

If you're using a Mac like I am, go to this page and look for the heading "For OS X 10.5". Download the latest Mercurial zip file, open it, and then run the installer in the new directory. Open a new Terminal window and make sure that "/usr/local/bin" is in your PATH and then verify that Mercurial runs by running "hg --version". Use the documentation mentioned above to become familiar with Mercurial. For other platforms, see other information on the Mercurial site.

When checking in code, it is useful to set your username in a ~/.hgrc file so the command does not complain. Mine is shown below. Other configuration options can also be placed in this file.

# This is a Mercurial configuration file.
[ui]
username = Edwin Goei <edwin.goei@sun.com>

A common setup is to use ssh to access a common repository. If you do not have a ~/.ssh directory, run the following command to create a key pair. Select the default location (~/.ssh/id_rsa) and use an empty passphrase.

% ssh-keygen -t rsa

Send the generated public key located in a file called ~/.ssh/id_rsa.pub or ~/id_dsa.pub to the repository administrator. They will add it to a authorized_keys file on the common repository host to grant you access.

The following shows some example commands that access a common repository.

% hg clone ssh://hgroot@santa.sfbay/hg/vapp
destination directory: vapp
no changes found
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
% cd vapp
% echo "This is a test" >> README.txt
% hg add README.txt
% hg ci -m "Initial README"
% hg push
pushing to ssh://hgroot@santa.sfbay/hg/vapp
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 2 changesets with 2 changes to 1 files
Comments:

thanks for this code. I'll try it.

Posted by parma on January 30, 2008 at 07:43 PM PST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

edwingo

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today