By edwingo on Jan 07, 2008
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 <email@example.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
~/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://firstname.lastname@example.org/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://email@example.com/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