[PATCH 3 of 3] histedit: replace @addhisteditaction with @action

timeless timeless at gmail.com
Wed Jan 20 11:15:00 CST 2016

On Tue, Jan 19, 2016 at 9:50 PM, Durham Goode <durham at fb.com> wrote:
>> +primaryactions = set()
>> +secondaryactions = set()
>> +tertiaryactions = set()
>> +internalactions = set()
> I just stumbled on this code and was confused.  What is the difference
> between these 4?

primary are special actions which we think are the most important
(should be first).
internal are things that histedit itself uses for state transitions
and which shouldn't be selected by users.
tertiary are things which don't have a short code and are thus much
less important.
secondary are things with a short code, but which aren't the most important.

> Is it just for sorting in the help text?

Yes, it's just sorting the help. Internal don't actually appear in the help.

> This seems like a strange way of representing sort order.
> Why not give each a priority value (from an enum) and just sort on it?

I don't really want people creating arbitrary enum values, e.g. 15.
I also don't want third party extensions to select things as "primary".
Your addins should fall naturally into internal/tertiary/secondary.

More information about the Mercurial-devel mailing list