Request for guidance for compatibility with Mercurial 4.6+

Yuya Nishihara yuya at tcha.org
Mon Sep 10 07:46:50 EDT 2018


On Mon, 10 Sep 2018 08:04:31 +0900, Yuya Nishihara wrote:
> > Source code of the relevant command in the JavaHg extension (
> > https://bitbucket.org/aragost/javahg/src/6af11cef7ff67822719b76a2dc8824585ae6c796/src/test/resources/javahg-test.py?at=default&fileviewer=file-view-default#javahg-test.py-61
> > ):
> > 
> > @command('javahg-write', [])
> > def writeToChannel(ui, repo, channel, msg):
> >     """write message to the given channel"""
> >     sys.stdout.write(struct.pack('>cI', channel, len(msg)) + msg)
> >     sys.stdout.flush()
> > 
> > This "output to stderr" did not happen in any of the versions I test JavaHg
> > against, i.e. 3.0—4.5.3. All previous versions provided an empty stderr. I
> > have not been able to figure out the explanation for this change in 4.6, so
> > that I could work around this change of behavior or take it into account.
> 
> Any invalid outputs are sent to stderr since 4.6 for maximum debuggability.
> Before, they were redirected to /dev/null.
> 
> In this example, sys.stdout should be replaced by ui.fout.

Never mind. In this particular example, we'll need to obtain a bare stdout
instance from ui.fout.out.


More information about the Mercurial-devel mailing list