Enhancing 'log' so it prints more info depending on an extension

Greg Ward greg-hg at gerg.ca
Thu Sep 24 13:34:41 CDT 2009


On Wed, Sep 23, 2009 at 6:31 PM, Yann E. MORIN
<yann.morin.1998 at anciens.enib.fr> wrote:

> In this thread [1], I found that 'log' was missing some usefull info
> that is stored by the 'transplant' extension. Namely, the transplanted
> changeset's source is not printed.
>
> I think it would be nice if the source was printed by the 'log' command,
> like both parents of a merge are. Of course 'parent' is reserved for
> merges and we should find another label (such as 'transplant source',
> or name it...).
>
> I was wondering what would be the best way to do this, and I came up with
> the following solutions:
>
> 1) override the 'log' command in the 'transplant' extension
>   - the 'log' command calls the original 'log' command,
>   - then print additional info

Alternately, see if it's possible for an extension to add new template
keywords.  Then either a) write your own extension or b) patch
transplant to add a {transplantsource} keyword.  Then you can write a
custom log template using {transplantsource}.  Ta-da.

(It sounds to me like patching transplant to add this keyword makes
sense: it keeps the core clean while making this feature as widely
available as transplant itself.  But then you have to sell your patch
to mercurial-devel.  Writing your own extension is a bit more work,
but you don't have to convince anyone to accept it... you can just
start using it.)

Greg



More information about the Mercurial-devel mailing list