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

Dan Villiom Podlaski Christiansen danchr at gmail.com
Thu Apr 15 14:14:05 CDT 2010


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.

--

Dan Villiom Podlaski Christiansen
danchr at gmail.com

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1943 bytes
Desc: not available
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20100415/c1f04040/attachment.bin>


More information about the Mercurial-devel mailing list