[PATCH 1 of 2] upgrade-repo: colorize some of the output

Pierre-Yves David pierre-yves.david at ens-lyon.org
Mon Dec 2 05:44:29 EST 2019



On 11/30/19 5:46 AM, Yuya Nishihara wrote:
> On Fri, 29 Nov 2019 16:51:11 +0100, Pierre-Yves David wrote:
>> # HG changeset patch
>> # User Pierre-Yves David <pierre-yves.david at octobus.net>
>> # Date 1575038205 -3600
>> #      Fri Nov 29 15:36:45 2019 +0100
>> # Node ID 55c69c19cb183f2c315cda4cacfc2d40741cf6e5
>> # Parent  aef7b91dba51b5f3fad8cf675e0b51b35d0fd5bb
>> # EXP-Topic sidedata-copies-perf
>> # Available At https://dev.heptapod.net/octobus/mercurial-devel/
>> #              hg pull https://dev.heptapod.net/octobus/mercurial-devel/ -r 55c69c19cb18
>> upgrade-repo: colorize some of the output
> 
> (I only reviewed this since I don't know the multiprocessing module.)
> 
>> diff --git a/mercurial/upgrade.py b/mercurial/upgrade.py
>> --- a/mercurial/upgrade.py
>> +++ b/mercurial/upgrade.py
>> @@ -1242,25 +1242,31 @@ def upgraderepo(
>>               ui.warn(msg % b', '.join(sorted(incompatible)))
>>               revlogs = UPGRADE_ALL_REVLOGS
>>   
>> +    def write_labeled(l, label):
>> +        first = True
>> +        for r in sorted(l):
>> +            if not first:
>> +                ui.write(', ')
>> +            ui.write(r, label=label)
>> +            first = False
>> +
>>       def printrequirements():
>>           ui.write(_(b'requirements\n'))
>> -        ui.write(
>> -            _(b'   preserved: %s\n')
>> -            % _(b', ').join(sorted(newreqs & repo.requirements))
>> +        ui.write(_(b'   preserved: '))
>> +        write_labeled(
>> +            newreqs & repo.requirements, "upgrade-repo.requirement.preserved"
>>           )
>> -
>> +        ui.write(_('\n'))
> 
>> +            ui.write(_('\n'))
> 
> Nit: these translation marker is pretty much useless.

Ha right. I don't see this change in the committed repository so I am 
sending a v2.

-- 
Pierre-Yves David


More information about the Mercurial-devel mailing list