[PATCH v2] progress: check stderr.isatty() before each print

Augie Fackler durin42 at gmail.com
Wed Jun 30 20:50:17 UTC 2010


On Jun 28, 2010, at 11:12 PM, Matt Mackall wrote:

> On Mon, 2010-06-28 at 20:49 -0500, Augie Fackler wrote:
>> On Jun 28, 2010, at 12:51 PM, Matt Mackall wrote:
>>
>>> On Sun, 2010-06-27 at 22:26 -0500, Augie Fackler wrote:
>>>> # HG changeset patch
>>>> # User Augie Fackler <durin42 at gmail.com>
>>>> # Date 1277695247 18000
>>>> # Branch stable
>>>> # Node ID eefb5d1f2c45e686ac501ccba0b24f5da968e920
>>>> # Parent  51021f4c80b5dcf608626ddc24b21c155df2cae8
>>>> progress: check stderr.isatty() before each print
>>>
>>> Ok, queued. We should try to fix this better somehow post-1.6.
>>
>> Totally agree. In fact, this could be improved slightly to only check
>> isatty() right before each print, once every 10th of a second instead
>> of every progress call. Should I resend that way? (That occurred to  
>> me
>> this afternoon while idly wondering what a better fix looks like.)
>
> Please.

Sorry, forgot to send this - looked, and the patch as sent (and  
already integrated) does this check only once every 10th of a second.

> Something for future us to consider: a way to hook into the config
> object such that changes to a given item would trigger a callback.  
> Then
> code that cared about ui.plain() could get notified when the mode was
> activated.

Indeed. I'll ponder this for a while. Offhand, it seems like we might  
want to add a way of writing interactive-only data to stderr to the ui  
object.

>
> -- 
> Mathematics is the supreme nostalgia of our time.
>
>




More information about the Mercurial-devel mailing list