Commits Extension

This extension is not distributed with Mercurial.

Author: Martin Blais

Download site: [http://furius.ca/pubcode/pub/conf/common/lib/python/hgblais/commits.py]

Home page: [http://furius.ca/pubcode/pub/conf/common/lib/python/hgblais/commits.py.html]

Works with: Mercurial 0.9.5 and beyond.

Overview

A Mercurial extension that allows the user to [:Commit:commit] modified files as multiple [:ChangeSet: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/tracing.py
    M common/lib/googoo/logging.c
    M common/lib/googoo/strutils.c

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

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

Configuration

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

[extensions]
commits = 

Place commits.py 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.


CategoryExtension