[PATCH 3 of 3] summary: add evolution "troubles" information to parents header lines

Denis Laxalde denis.laxalde at logilab.fr
Tue Nov 8 14:18:52 UTC 2016


Yuya Nishihara a écrit :
> On Mon, 10 Oct 2016 14:33:19 +0200, Denis Laxalde wrote:
>> # HG changeset patch
>> # User Denis Laxalde <denis.laxalde at logilab.fr>
>> # Date 1475935828 -7200
>> #      Sat Oct 08 16:10:28 2016 +0200
>> # Node ID 1ec84349bfa3db4e753f9084837c7ea2f0c3a4b9
>> # Parent  d9f7776c40b8c82bf438322f2442d99c4e116161
>> # EXP-Topic evolve-ui
>> summary: add evolution "troubles" information to parents header lines
>>
>> Extend labels of the `parent: ` line according to what `hg log` displays when
>> coming from changeset_printer. This would make this line appear the same in
>> log and summary with custom colors in particular.
>>
>> Extend that line with "troubles" information in parentheses, when the parent
>> is troubled.
>>
>> diff --git a/mercurial/commands.py b/mercurial/commands.py
>> --- a/mercurial/commands.py
>> +++ b/mercurial/commands.py
>> @@ -6778,7 +6778,7 @@ def summary(ui, repo, **opts):
>>          # shows a working directory parent *changeset*:
>>          # i18n: column positioning for "hg summary"
>>          ui.write(_('parent: %d:%s ') % (p.rev(), str(p)),
>> -                 label='log.changeset changeset.%s' % p.phasestr())
>> +                 label=cmdutil._changesetlabels(p))
>>          ui.write(' '.join(p.tags()), label='log.tag')
>>          if p.bookmarks():
>>              marks.extend(p.bookmarks())
>> @@ -6787,6 +6787,14 @@ def summary(ui, repo, **opts):
>>                  ui.write(_(' (empty repository)'))
>>              else:
>>                  ui.write(_(' (no revision checked out)'))
>> +        if p.troubled():
>> +            ui.write(' (')
>> +            ui.write(_('troubles: '),
>> +                     label='log.changeset changeset.troubled')
>> +            for trouble in p.troubles():
>> +                ui.write(trouble,
>> +                         label='trouble.%s' % trouble)
>> +            ui.write(')')
>
> Why do we need it in addition to the existing unstable/divergent/bumped
> fields?
>

The intent here is to display "troubles" information of the parents. If
I understand correctly, the unstable/divergent/bumped fields you are
referring to display statistics on the whole repository.

(Sorry for the late reply, I missed this one.)


More information about the Mercurial-devel mailing list