Mac OS X(Lion)にmercurialをインストール

前提:Homebrewがインストールされていること。

1. pythonをインストール


$ brew install python
==> Installing python dependency: pkg-config
==> Downloading http://pkgconfig.freedesktop.org/releases/pkg-config-0.25.tar.gz
######################################################################## 100.0%
==> ./configure --disable-debug --prefix=/usr/local/Cellar/pkg-config/0.25 --with-pc-path=/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/lib/pkgconfig:/usr/X11/li
==> make
==> make check
==> make install
/usr/local/Cellar/pkg-config/0.25: 9 files, 228K, built in 28 seconds
==> Installing python dependency: sqlite
==> Downloading http://www.sqlite.org/sqlite-autoconf-3071201.tar.gz
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/sqlite/3.7.12.1 --enable-dynamic-extensions
==> make install
/usr/local/Cellar/sqlite/3.7.12.1: 9 files, 1.9M, built in 42 seconds
==> Installing python dependency: gdbm
==> Downloading http://ftpmirror.gnu.org/gdbm/gdbm-1.10.tar.gz
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/gdbm/1.10 --mandir=/usr/local/Cellar/gdbm/1.10/share/man --infodir=/usr/local/Cellar/gdbm/1.10/share/info
==> make install
/usr/local/Cellar/gdbm/1.10: 10 files, 224K, built in 12 seconds
==> Installing python
==> Downloading http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tar.bz2
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/python/2.7.3 --enable-shared
==> make
==> make install
==> Downloading http://pypi.python.org/packages/source/d/distribute/distribute-0.6.27.tar.gz
######################################################################## 100.0%
==> /usr/local/Cellar/python/2.7.3/bin/python setup.py install
==> Downloading http://pypi.python.org/packages/source/p/pip/pip-1.1.tar.gz
######################################################################## 100.0%
==> /usr/local/Cellar/python/2.7.3/bin/python setup.py install
==> Caveats
A "distutils.cfg" has been written to:
/usr/local/Cellar/python/2.7.3/lib/python2.7/distutils
specifing the install-scripts folder as:
/usr/local/share/python

If you install Python packages via "pip install x" or "python setup.py install"
(or the outdated easy_install), any provided scripts will go into the
install-scripts folder above, so you may want to add it to your PATH.

Distribute has been installed. To update distribute itself outside of Homebrew:
/usr/local/share/python/pip install --upgrade distribute

See: https://github.com/mxcl/homebrew/wiki/Homebrew-and-Python
==> Summary
/usr/local/Cellar/python/2.7.3: 4810 files, 81M, built in 25.3 minutes

2. mercurialをインストール


$ brew install mercurial
==> Downloading http://mercurial.selenic.com/release/mercurial-2.2.2.tar.gz
######################################################################## 100.0%
==> make PREFIX=/usr/local/Cellar/mercurial/2.2.2 build
==> make PREFIX=/usr/local/Cellar/mercurial/2.2.2 install-bin
/usr/local/Cellar/mercurial/2.2.2: 501 files, 6.7M, built in 15 seconds

3. インストールしたmercurialのversionの確認


$ hg version
Mercurial Distributed SCM (version 2.2.2)
(see http://mercurial.selenic.com for more information)

Copyright (C) 2005-2012 Matt Mackall and others
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.