[PATCH 4 of 8] progress: slightly nicer handling of nested progress topics

Martin Geisler mg at aragost.com
Wed Dec 15 09:03:49 CST 2010


Augie Fackler <durin42 at gmail.com> writes:

> On Dec 15, 2010, at 5:19 AM, Martin Geisler wrote:
>> 
>> Augie Fackler <durin42 at gmail.com> writes:
>> 
>>> # HG changeset patch
>>> # User Augie Fackler <durin42 at gmail.com>
>>> # Date 1287459980 18000
>>> # Node ID 50766f487403088037b03f8d183a2bb30f03c1dd
>>> # Parent  81e2508690be5edc7a418472f891c125ed33907d
>>> progress: slightly nicer handling of nested progress topics
>>> 
>>> Previously we'd declare "complete" after an inner progress topic
>>> completed and erase the progress bar. Now we print the state of the
>>> enclosing progress topic as it was last recorded.
>>> 
>>> diff --git a/hgext/progress.py b/hgext/progress.py
>>> --- a/hgext/progress.py
>>> +++ b/hgext/progress.py
>>> @@ -62,6 +62,7 @@
>>> 
>>>     def resetstate(self):
>>>         self.topics = []
>>> +        self.topicstates = {}
>>>         self.pendingtopics = {}
>>>         self.printed = False
>>>         self.lastprint = time.time() + float(self.ui.config(
>>> @@ -76,8 +77,12 @@
>>>     def show(self, topic, pos, item, unit, total):
>>>         if not shouldprint(self.ui):
>>>             return
>>> +        if self.printed == (topic, pos, item, unit, total):
>>> +            # don't double-print progress information, otherwise
>>> +            # possible in the case of unwinding the topic stack
>>> +            return
>> 
>> This part was removed in changeset f139f34ba330 (progress: react more
>> reasonably to nested progress topics) which was pushed. But it seems
>> to be important -- I have a patch that adds progress output to 'hg
>> archive', and I see doubled output:
>
> I actually left it out intentionallly. This shouldn't happen in
> practice outside of tests, and it means that when the steps are
> reasonably large we'll update the ETA so the user can tell we're not
> frozen.

Ah, that sounds good. I'll push the patch with the double output then.

-- 
Martin Geisler

aragost Trifork
Professional Mercurial support
http://mercurial.aragost.com/kick-start/


More information about the Mercurial-devel mailing list