Mercurial Logo

The Mercurial SCM

Matt Mackall, mpm@selenic.com

Why A New SCM?

Existing systems suffer from several problems:

Mercurial is:

Why a decentralized system?

The Mercurial basics

Making a commit

Revisions, Changesets, Heads, and Tip

Cloning, Merging, and Pulling

Let's start with a user Alice, who has a store that looks like:

Bob clones this repo, and ends up with a complete copy of Alice's store (though his working directory is independent!):

Bob then commits a couple changes:

Alice then makes her own change in parallel:

Bob then pulls Alice's repo to synchronize. This copies all of Alice's changes into Bob's repo:

Bob then does a merge which combines the last change he was working on (f) with the tip, commits the result, and ends up with:

Now if Alice pulls from Bob, she will get Bob's changes e, f, and h, and they will be fully synchronized:

Multiple ways to share repositories

Using cheap branches to manage changes

New features can be added with extensions

For more information