Differences between revisions 2 and 3
Revision 2 as of 2008-02-09 17:21:50
Size: 2683
Editor: abuehl
Comment: linking
Revision 3 as of 2008-02-09 17:32:13
Size: 2690
Editor: abuehl
Comment:
Deletions are marked like this. Additions are marked like this.
Line 51: Line 51:
and also functions as a special symbolic tag. and also functions as a special symbolic [:Tag:tag].

What are revision numbers, changeset IDs, and tags?

Mercurial will generally allow you to refer to a revision in three ways: by revision number, by [:ChangeSetID:changeset ID], and by [:Tag:tag].

A [:RevisionNumber:revision number] is a simple decimal number that corresponds with the ordering of [:Commit:commits] in the local [:Repository:repository]. It is important to understand that this ordering can change from machine to machine due to Mercurial's distributed, decentralized architecture.

This is where changeset IDs come in. A changeset ID is a 160-bit identifier that uniquely describes a changeset and its position in the change history, regardless of which machine it's on. This is represented to the user as a 40 digit hexadecimal number. As that tends to be unwieldy, Mercurial will accept any unambiguous substring of that number when specifying versions. It will also generally print these numbers in "short form", which is the first 12 digits.

You should always use some form of changeset ID rather than the local revision number when discussing revisions with other Mercurial users as they may have different revision numbering on their system.

Finally, a [:Tag:tag] is an arbitrary string that has been assigned a correspondence to a changeset ID. This lets you refer to [:Revision:revisions] symbolically.

What are branches, heads, and the tip?

The central concept of Mercurial is [:Branch:branching]. A 'branch' is simply an independent line of development. In most other version control systems, all users generally commit to the same line of development called 'the trunk' or 'the main branch'. In Mercurial, every developer effectively works on a private branch and there is no internal concept of 'the main branch'.

Thus Mercurial works hard to make repeated [:Merge:merging] between branches easy. Simply run hg pull (see ["Pull"]), hg merge and [:Commit:commit] the result.

'[:Head:Heads]' are simply the most recent commits on a branch. Technically, they are [:ChangeSet:changesets] which have no children. Merging is the process of joining points on two branches into one, usually at their current heads. Use "hg heads" to find the heads in the current [:Repository:repository].

The '[:Tip:tip]' is the most recently changed head, and also the highest numbered revision. If you have just made a commit, that commit will be the tip. Alternately, if you have just pulled from another repository, the tip of that repository becomes the current tip.

The 'tip' is the default revision for many commands such as update, and also functions as a special symbolic [:Tag:tag].

FAQ/Terminology (last edited 2012-11-11 19:38:40 by abuehl)