Mercurial is a source-code management tool which allows users to keep track of changes to the source code locally and share their changes with others. It is used for the development of Firefox.

Client settings

Installing and configuring Mercurial

See Installing Mercurial.

Checking out a source tree

There are multiple hg repositories hosted at See for the full list.

mozilla-central (main development tree)

Most developers write patches against the mozilla-central tree.

Clone mozilla-central to get a local copy of the repository and then cd into it:

# This may take a while...
hg clone firefox
cd firefox

Latest successful build

The latest committed changes in your checkout may not build successfully. You may want to get the source code that has passed the automatic tests.

mozilla-inbound (used for landing your patches)

Most developers also maintain a clone of mozilla-inbound, which they use for landing their patches.  You probably want to develop on top of mozilla-central, which tends to be more stable, but you should use mozilla-inbound when your patches are ready to land.  See this page for how checking code into mozilla-inbound works.

hg clone inbound
cd inbound

mozilla-beta (prerelease development tree)

When a new release of Firefox enters beta testing, the code is branched into  mozilla-beta. This code represents the expected next release of the Firefox browser, and should be pretty stable. If you want to build off this branch, you can clone the repository as follows:

# Pull the Mozilla source to the folder beta-src/ - may take a while 
# as hundreds of megabytes of history is downloaded to .hg
hg clone beta

cd beta

mozilla-release (release tree)

To get the source repository for the current release of Firefox, do the following:

hg clone release
cd release

comm-central (Thunderbird/SeaMonkey/Calendar)

See Comm-central source code (Mercurial) for further information on pulling and building with comm-central.

L10n repos

If you are creating a new localization based on an already-localized version of a Mozilla project, you will be interested in cloning this code. Code for all l10n projects lives in l10n-central and is organized (in most cases) by the locale's two character ISO code. When cloning, use the same ISO code to name the local directory that will store it. To get this code, do the following:

# Pull the Mozilla source to the folder src/ - may take a while 
# as hundreds of megabytes of history is downloaded to .hg
hg clone yourISOcode

cd yourISOcode


See Mercurial bundles for information about downloading a single large file instead of using "hg clone".

Using a Unified Repository

There are multiple repositories for Firefox. It is common to want to interact with more than 1 of them. See for instructions on doing this efficiently.


By default with no configuration a similar-to-release build is done. If you wish you can configure the build using a .mozconfig file and make -f Different OSs have different prerequisites for a successful build, please refer to the build documentation to verify they are available on your build machine.

See also

  • The Mercurial page has information about creating diffs, committing changes, and publishing shared repositories.
  • Check out this link if you prefer to work with git repository.