[PATCH 1 of 3] progress: move from extension to core

Martin Geisler martin at geisler.net
Sat May 12 13:10:24 CDT 2012


Idan Kamara <idankk86 at gmail.com> writes:

> On Sat, May 12, 2012 at 5:39 PM, Martin Geisler <mrtn.gslr at gmail.com> wrote:
>
>> # HG changeset patch
>> # User Martin Geisler <martin at geisler.net>
>> # Date 1336829943 -7200
>> # Node ID bd17c94b246bb7b4b8cfec24e491310bd54e3f8b
>> # Parent  654b9e1966f76d38b11fbd1d518efce5d58caa88
>> progress: move from extension to core
>>
>> The old progress extension is now ignored, so people can keep loading
>> it in their existing config.
>>
>> This also somehow fixed a problem with doubled progress bars: two
>> progress bars would be printed, though they had the same information.
>> This was therefore not visible in normal usage, it only showed up in
>> the test suite.
>>
>> diff --git a/mercurial/extensions.py b/mercurial/extensions.py
>> --- a/mercurial/extensions.py
>> +++ b/mercurial/extensions.py
>> @@ -11,7 +11,7 @@
>>
>>  _extensions = {}
>>  _order = []
>> -_ignore = ['hbisect', 'bookmarks', 'parentrevspec']
>> +_ignore = ['hbisect', 'bookmarks', 'parentrevspec', 'progress']
>>
>>  def extensions():
>>     for name in _order:
>> diff --git a/hgext/progress.py b/mercurial/progress.py
>> rename from hgext/progress.py
>> rename to mercurial/progress.py
>> --- a/hgext/progress.py
>> +++ b/mercurial/progress.py
>> @@ -38,14 +38,16 @@
>>  import sys
>>  import time
>>
>> -from mercurial import util
>> -from mercurial.i18n import _
>> +import util
>> +from i18n import _
>>
>>  def spacejoin(*args):
>>     return ' '.join(s for s in args if s)
>>
>>  def shouldprint(ui):
>> -    return util.isatty(sys.stderr) or ui.configbool('progress',
>> 'assume-tty')
>> +    return (not ui.configbool('progress', 'disabled')
>> +            and (util.isatty(sys.stderr)
>> +                 or ui.configbool('progress', 'assume-tty')))
>>
>
> I'm guessing util.isatty(sys.stderr) = False when this gets called
> from the cmdserver, but it's worth running python-hglib's and JavaHg
> tests to make sure it doesn't break anything.

Interesting idea, I hadn't though of that... I just tried the JavaHg
tests and they still pass.

-- 
Martin Geisler

aragost Trifork
Professional Mercurial support
http://aragost.com/mercurial/


More information about the Mercurial-devel mailing list