Commits Extension

This extension is not distributed with Mercurial.

Author: Martin Blais

Source code:

Web page:

Compatibility: Mercurial 0.9.5 and beyond. Unix-only (depends on the termios module).


A Mercurial extension that allows the user to commit modified files as multiple changesets, in a single operation. An editor is invoked with the current list of modified files, and the user needs to edit the file, adding a single comment line before each set of lines, separated by some empty lines between each desired changeset, something like this:

    Modified project files.
    M docs/flair.txt
    M docs/dmping.txt

    Added extra careful tracing and assertions.
    M common/lib/pyfff/
    M common/lib/googoo/logging.c
    M common/lib/googoo/strutils.c

    New test utilities.
    M docs/testutils.txt
    M common/lib/pyfff/
    A common/lib/pyfff/testutil

Each set will be committed independently when you exit the editor.


Configure your .hgrc to enable the extension by adding following lines:

commits = 

Place somewhere accessible from your PYTHONPATH.

Usage Scenario

When you do work on many different tasks in a single checkout (that's pretty much "all the time" for the author) and would like to split your commits into coherent tasks, use this to partition your modified files in distinct commits instead of the 'commit' command. In your text editor, just edit the file as above.

See also

You may also interest in the RecordExtension.


CommitsExtension (last edited 2012-11-06 14:58:28 by abuehl)