[PATCH] diffstat: use ui.plain() instead of ui.interactive()

Augie Fackler lists at durin42.com
Thu Apr 15 14:33:22 CDT 2010


On Thu, Apr 15, 2010 at 2:14 PM, Dan Villiom Podlaski Christiansen
<danchr at gmail.com> wrote:
> On 15 Apr 2010, at 21:00, Alexander Solovyov wrote:
>
>> On 2010-04-15, Dan Villiom Podlaski Christiansen wrote:
>>
>>> -        width = ui.interactive() and util.termwidth() or 80
>>> +        if not ui.plain():
>>> +            width = util.termwidth()
>>> +        else:
>>> +            width = 80
>>
>> Hm, why not just change ui.interactive() to ui.plain()? :-)
>
> I believe the two serve quite different purposes:
> - non-interactive means precisely that; the session can't request input from the user.
> - plain means that some customisation has been disabled, and is designed for use in scripts.
>
> I don't know whether plain currently implies non-interactive. However, most use of the plain mode is likely to be non-interactive too.

He meant your diff could be:
-        width = ui.interactive() and util.termwidth() or 80
+        width = ui.plain() and util.termwidth() or 80

Seems better to me.

>
> --
>
> Dan Villiom Podlaski Christiansen
> danchr at gmail.com
>
>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel
>
>


More information about the Mercurial-devel mailing list