[PATCH] extensions: allow replacing command synopsis

Ryan McElroy rm at fb.com
Wed Feb 11 10:32:50 CST 2015


On 2/11/2015 6:37 AM, Augie Fackler wrote:
> On Feb 10, 2015, at 10:43 PM, Ryan McElroy <rm at fb.com> wrote:
>
>> # HG changeset patch
>> # User Ryan McElroy <rm at fb.com>
>> # Date 1423508565 28800
>> #      Mon Feb 09 11:02:45 2015 -0800
>> # Node ID dac1fbb56786c2033e188e7b762a9429cd7ff621
>> # Parent  ff5caa8dfd993680d9602ca6ebb14da9de10d5f4
>> extensions: allow replacing command synopsis
> Hm, interesting. Can you give a sample reason why we should support this?
>
In general, this will allow extensions that wrap/extend commands to be 
better integrated.

Specifically, in the remotenames extension, we're adding some new flags 
to commands -- some examples are --to to the push command, and --all and 
--remote to bookmarks. Today, you can't edit the synopsis string in the 
command tuple because tuples and strings are both immutable. The list of 
args is extensible because it's a list (and editing a list doens't 
change the tuple that contains it). However, we are unable to add the 
new flags to the command synopsis. This would allow us to do that.

I can update the commit message to include these reasons and send out a 
V2 -- let me know.


More information about the Mercurial-devel mailing list