[PATCH 1 of 2 V2] log: flush stdout/err for the first log entries
Yuya Nishihara
yuya at tcha.org
Wed Sep 30 10:13:59 CDT 2015
On Tue, 29 Sep 2015 17:11:43 -0500, Matt Mackall wrote:
> On Wed, 2015-09-30 at 00:52 +0900, Yuya Nishihara wrote:
> > On Mon, 28 Sep 2015 18:17:52 -0500, Matt Mackall wrote:
> > > On Mon, 2015-09-28 at 00:15 +0900, Yuya Nishihara wrote:
> > > > a) sys.stdout = fdopen(sys.stdout.fileno(), 'wb', 1) # 1 for line buffering
> > > >
> > > > can't replace all FILE* objects because sys.stdout may be aliased to
> > > > different names, such as ui.fout.
> > >
> > > I couldn't get this to work for some reason when I tried a few months
> > > back. But if you can get it working, this is probably the cleanest
> > > approach.
> >
> > At least, we have to replace sys.stdout and ui.fout (and more?) by new object.
>
> I think that's fine. Just about everything goes through ui anyway.
Ok, I'll try this way. I'll check out the use of sys.__stdout__ as we sometimes
use it to test if the given file object is a stdout.
More information about the Mercurial-devel
mailing list