Buffering in mercurial with redirected output

Greg Ward greg-hg at gerg.ca
Tue Jan 4 14:40:41 CST 2011


On Tue, Jan 4, 2011 at 2:56 AM, Sergey Antonov <sergant_ at mail.ru> wrote:
> I'm using a mercurial command line client with redirected output to make a
> GUI around some of mercurial commands.
>
> The problem I have is that the output is buffered and I don't get any output
> from the command until it ends or until there is more output then the buffer
> length.
>
> For example, when I use it for commands: incoming, outgoing, pull, push, I
> would like to show every line as soon as it is available.
>
> Is there a way to disable buffering of redirected output ?

You could invoke hg with "python -u".  Or set PYTHONUNBUFFERED=1.
"man python" for details.

Greg


More information about the Mercurial-devel mailing list