Commit

hg commit [OPTION]... [FILE]...

A commit is the creation of a new changeset in a repository, based on the state of the working directory. During the commit, a description for the change made should be provided (see ChangeSetComments).

Committing changes in the working directory creates a new revision in the manifest1 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.

See DirState for the details how Mercurial detects which files will be included in the commit.

As a result of the commit, Mercurial calculates the changeset ID and stores it with the changeset in the changelog.

By default Mercurial uses a username of the form user@localhost for commits. This is often meaningless. It's best to configure a proper email address in ~/.hgrc (or on Windows in %USERPROFILE%\Mercurial.ini) by adding lines such as the following:

[ui]
username = John Doe <john@example.com>

Help text: http://www.selenic.com/mercurial/hg.1.html#commit


CategoryCommand

  • 1 In most cases a new manifest revision is created, for example when at least one tracked file has changed its content. However, multiple changesets may refer to the same manifest revision.

Commit (last edited 2008-06-04 23:13:33 by AdrianBuehlmann)