One thing missing from cadmium is anything like the wx ability to store
pending sccs delta comments in the active file.

I spent a little time on my flight back from California last night
cobbling together a mercurial extension which provides the capability to
store a pending commit message in a repo.

I was actually pleasantly surprised at how easy this was. 

The extension adds a new command, "hg message", which manipulates the
pending message, and interposes on several commands which take commit
messages as arguments to use that pending message as the default/initial
editor buffer content.

It adds -D and -E options to commands that have -l and -m; "-D" takes
the pending commit message as-is, while -E forces you into the editor
(which could be useful with -l).

I'm not sure what the appropriate way to distribute this (and what
license to drop into it, yadda yadda), and I haven't hooked it up to
cadmium recommit, but here's a teaser:

% mkdir xx
% cd xx
% hg init
% echo foo >foo
% hg message -m foo
% hg message
foo
% hg add foo  
% hg commit -D
% hg log -v
changeset:   0:501629b8acdb
tag:         tip
user:        Bill Sommerfeld <sommerfeld at sun.com>
date:        Thu Jun 19 13:03:58 2008 -0400
files:       foo

foo


% hg help message
hg message [OPTION]...

view, change, or edit the pending commit message.

    With no options, display the pending commit message.

    With -m or -l, set the pending commit message.

    With -E, start the configured editor to edit the pending commit
message.

options:

 -m --message  use <text> as saved commit message
 -l --logfile  read saved commit message from <file>
 -E --edit     edit saved commit message 

use "hg -v help message" to show global options
% hg help commit
hg commit [OPTION]... [FILE]...

aliases: ci

commit the specified files or all outstanding changes

    Commit changes to the given files into the repository.

    If a list of files is omitted, all changes reported by "hg status"
    will be committed.

    If you are committing the result of a merge, do not provide any
    file names or -I/-X filters.

    If no commit message is specified, the configured editor is started
to
    enter a message.

    See 'hg help dates' for a list of formats valid for -d/--date.

options:

 -A --addremove     mark new/missing files as added/removed before
committing
 -I --include       include names matching the given patterns
 -X --exclude       exclude names matching the given patterns
 -m --message       use <text> as commit message
 -l --logfile       read commit message from <file>
 -d --date          record datecode as commit date
 -u --user          record user as committer
 -D --defmessage    Use default commit message
 -E --force-editor  Always start editor on commit message

use "hg -v help commit" to show global options
% hg message -m "foo"
% hg message
foo




Reply via email to