[PATCH] commands: add an option to display only the full id with 'hg id'
Mathias De Maré
mathias.demare at gmail.com
Sun Nov 22 02:24:38 CST 2015
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
>> <mailto:yuya at tcha.org>> wrote:
>>
>> On Thu, 19 Nov 2015 07:58:16 -0600, Mathias De Maré wrote:
>> > # HG changeset patch
>> > # User Mathias De Maré <mathias.demare at gmail.com
>> <mailto:mathias.demare at gmail.com>>
>>
>> > # Date 1447866343 -3600
>> > # Wed Nov 18 18:05:43 2015 +0100
>> > # Node ID afb732f543249e09acfd0438747223fbf7a4484f
>> > # Parent 53c668dc6b1601c8bda5098df4e33030dbdb454d
>> > commands: add an option to display only the full id with 'hg id'
>> >
>> > 'hg id --full' can display the full revision id without having to
>> use --debug.
>> > This avoids potential additional debug messages being printed
>> > and is more intuitive (it's a specific option to 'hg id').
>> >
>> > diff --git a/mercurial/commands.py b/mercurial/commands.py
>> > --- a/mercurial/commands.py
>> > +++ b/mercurial/commands.py
>> > @@ -4165,6 +4165,7 @@
>> > _('identify the specified revision'), _('REV')),
>> > ('n', 'num', None, _('show local revision number')),
>> > ('i', 'id', None, _('show global revision id')),
>> > + ('', 'full', None, _('show full global revision id')),
>> > ('b', 'branch', None, _('show branch')),
>> > ('t', 'tags', None, _('show tags')),
>> > ('B', 'bookmarks', None, _('show bookmarks')),
>> > @@ -4172,7 +4173,8 @@
>> > _('[-nibtB] [-r REV] [SOURCE]'),
>> > optionalrepo=True)
>> > def identify(ui, repo, source=None, rev=None,
>> > - num=None, id=None, branch=None, tags=None,
>> bookmarks=None, **opts):
>> > + num=None, id=None, branch=None, tags=None,
>> bookmarks=None,
>> > + full=None, **opts):
>> > """identify the working directory or specified revision
>> >
>> > Print a summary identifying the repository state at REV
>> using one or
>> > @@ -4194,6 +4196,11 @@
>> >
>> > hg id --id > build-id.dat
>> >
>> > + - generate a build identifier with the full revision id
>> > + for the working directory::
>> > +
>> > + hg id --full > build-id.dat
>>
>> 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).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20151122/4612cfa9/attachment.html>
More information about the Mercurial-devel
mailing list