[PATCH 1 of 5] summary: augment output with info from extensions

Kevin Bullock kbullock+mercurial at ringworld.org
Tue May 14 14:20:36 CDT 2013


On May 14, 2013, at 2:18 PM, Kevin Bullock wrote:

> On May 14, 2013, at 1:24 PM, Bryan O'Sullivan wrote:
> 
>> # HG changeset patch
>> # User Bryan O'Sullivan <bryano at fb.com>
>> # Date 1368555795 25200
>> #      Tue May 14 11:23:15 2013 -0700
>> # Node ID 50703ffc65cfec6e37f31c74da5e2acf22c9ac08
>> # Parent  d77922fd8798acbf6daa0435eb7a7b1c13e3918b
>> summary: augment output with info from extensions
>> 
>> [...]
>> diff --git a/mercurial/util.py b/mercurial/util.py
>> --- a/mercurial/util.py
>> +++ b/mercurial/util.py
>> @@ -1946,3 +1946,19 @@ def sizetoint(s):
>>        return int(t)
>>    except ValueError:
>>        raise error.ParseError(_("couldn't parse size: %s") % s)
>> +
>> +class hooks(object):
>> +    '''A collection of hook functions that can be used to extend a
>> +    function's behaviour. Hooks are called in lexicographic order,
>> +    based on the names of their sources.'''
> 
> Sure looks like it should be in its own patch.
> 
> Also, the name 'hooks' is misleading, since it's apparently unrelated to the existing pre/post-operation user-configured hooks.

I should say, I'm in favor of the approach of having commands explicitly provide places for extensions to hook in, rather that forcing them to wrap functions in commands for common cases like this.

pacem in terris / мир / शान्ति / ‎‫سَلاَم‬ / 平和
Kevin R. Bullock



More information about the Mercurial-devel mailing list