[PATCH] commands: add an option to display only the full id with 'hg id'

Pierre-Yves David pierre-yves.david at ens-lyon.org
Sun Nov 22 23:13:27 CST 2015



On 11/22/2015 08:08 AM, Yuya Nishihara wrote:
> On Sun, 22 Nov 2015 09:24:38 +0100, Mathias De Maré wrote:
>> On Fri, Nov 20, 2015 at 4:09 AM, Pierre-Yves David <
>> pierre-yves.david at ens-lyon.org> wrote:
>>> On 11/19/2015 06:51 AM, Mathias De Maré wrote:
>>>> On Thu, Nov 19, 2015 at 3:36 PM, Yuya Nishihara <yuya at tcha.org
>>>>      I don't think --full is intuitive because it does two things, select
>>>>      --id
>>>>      and enable full hash. Perhaps we should avoid bloating formatting
>>>>      options by
>>>>      -T template.
>>>>
>>>> I thought it would be useful to have a single option for this. The
>>>> templating makes it less obvious for an average user.
>>>> I could change '--full' so it enables the full hash, but does not select
>>>> --id.
>>>>
>>>
>>> I'm in favor of keeping this at the templating level.
>>>
>> Would this be the full templating system also used for log?
>> Just to clarify (since this will make 'hg id' a lot more advanced).
>
> It will use ui.formatter(), but I think it won't be simple.

I'm thinking about pointing people from `hg id -r x --debug`
to `hg log -T {node} -r x`

We probably can't really introduces templater support for `hg id`. This 
is one of this antediluvian command with a strange contract. `hg id` can 
be used on a remote repository (to know the hash of various name there). 
In the remote case we do not have any infrastructure to build changectx 
and feed them to the templater.

(Well we could make stuff work for the local case, but meh)

Pointing at hg log -T and hg summary is probably a better experience for 
current `hg id` user.

-- 
Pierre-Yves David


More information about the Mercurial-devel mailing list