Changeset

(for a short intro of the basic concepts of Mercurial, see UnderstandingMercurial)

A changeset (sometimes abbreviated "cset") is an atomic collection of changes to files in a [:Repository:repository]. It contains all recorded [:LocalModifications:local modfication] that lead to a new [:Revision:revision] of the repository.

A changeset is identified uniquely by a [:ChangeSetID:changeset ID]. In a single repository, you can identify it using a [:RevisionNumber:revision number].

The act of creating a changeset is called a [:Commit:commit] or checkin. The information in a changeset includes

Each changeset has zero, one or two [:Parent:parent] changesets. It has two parent changesets, if the commit was a [:Merge:merge]. It has no parent, if the changeset is a root in the repository. There may be multiple roots in a repository (normally, there is only one), each representing the start of a branch.

If a changeset is not the [:Head:head] of a branch, it has one or more child changesets (it is then the parent of its child changesets).

Technically, the parent changesets of a changeset are retrieved from the revision history of the changelog file(s) in the repository (files 00changelog.i and 00changelog.d in .hg/store). Each changeset references a revision of the [:Manifest:manifest] (see ["Design"] for the technical details).

The [:WorkingDirectory:working directory] can be [:Update:updated] to any commited changeset of the repository, which then becomes the parent of the working directory.

Committing changes in the working directory creates a new revision in the manifest and a new changeset (a new revision in the changelog). The parent(s) of the working directory become the parents of the new changeset and the new changeset becomes the new parent of the working directory.

"Updating" back to a changeset which already has a child, changeing files and then committing creates a new child changeset, thus starting a new branch. Branches can be [:NamedBranches:named].

See also: ["ChangeSetComments"]


CategoryGlossary