Mozilla.com

  1. MDC
  2. Main Page
  3. Installing Mercurial

Installing Mercurial

^ 

Note: If you have not yet read the Mercurial basics do so now, or see Mercurial for other resources.

Installing

On Windows:
Mercurial comes with MozillaBuild. See also wikimo:Mercurial on Windows.

Other systems:
If you use apt-get, emerge, port, yast, or yum to install software, just do the usual. If this gives you an old version (pre-1.0 -- check with hg version), you can update it using easy_install as follows (using apt-get in this example):
sudo apt-get install python-setuptools python-dev build-essential
sudo easy_install -U mercurial

Otherwise, the Mercurial binary packages are for you.

Merge program

After installing, choose a merge program. Seriously. Do it now. If you don't, Mercurial will choose one for you and spring it on you when you least expect it.

A reasonable thing to do is to set ui.merge=internal:merge in the Mercurial configuration file (see below), which makes Mercurial try to merge changes and add the conflict markers (a la CVS) to the files that couldn't be merged.

You can see the list of merge conflicts by looking for "merging ... failed!" in the update output.

Configuration

You should configure Mercurial before pulling the code. Your mercurial configuration file should have at least the following settings:

[ui]
username = Your Real Name <user@example.com>
merge = your-merge-program

[diff]
git = 1

[defaults]
diff=-p -U 8

On Windows, these settings can be added to C:\Program Files\Mercurial\Mercurial.ini. On UNIX-like systems, they should be in your $HOME/.hgrc file.

You can configure the editor to use for commit messages using the editor option in the [ui] section or by setting the EDITOR environment variable.

Languages

Page last modified 21:42, 12 Aug 2008 by Steffen

Files (0)