[PATCH] Use the pager given by the environment to display long output

David Soria Parra sn_ at gmx.net
Tue Mar 18 17:27:05 CDT 2008


Bryan O'Sullivan wrote:
> David Soria Parra wrote:
> 
>> Here is the updated patch.
> 
> self.pager still isn't necessary, because the filehandle will be flushed
> and closed upon deletion.  Adding a __del__ method doesn't buy you anything.
> 
> 	<b
> 
> 


I think it makes sense to use __del__ here. If we use a pager, and we have a long output (e.g. the
mercurial repository) and you quit the pager before mercurial finished to write the complete output
to the pager, you will get a "BROKEN PIPE" from the pager.

To don't avoid people all the time, I think it's better to catch the IOException from python in
__del__ (as this is the only place to do that). It really annoyed me to see the Broken Pipe message
all the time and I think people get confused by that more than that "error" helps them.

                  david



More information about the Mercurial-devel mailing list