Submitter | Yuya Nishihara |
---|---|
Date | July 25, 2020, 2:27 p.m. |
Message ID | <cd333962901c4142d6b2.1595687269@mimosa> |
Download | mbox | patch |
Permalink | /patch/46909/ |
State | Accepted |
Headers | show |
Comments
On Sat, Jul 25, 2020 at 7:59 PM Yuya Nishihara <yuya@tcha.org> wrote: > > # HG changeset patch > # User Yuya Nishihara <yuya@tcha.org> > # Date 1595685086 -32400 > # Sat Jul 25 22:51:26 2020 +0900 > # Branch stable > # Node ID cd333962901c4142d6b29deae1851bca6c51f587 > # Parent 41021660baa1bdb3fb089d6ddb6b6658c9e540b1 > dispatch: adjust ui.flush() timing to stabilize test-blackbox.t > > Without this change, dispatch.dispatch() could return before flushing all > stdio data. This means chg stdio would print data after receiving the result > code. Thanks a lot for looking into this. Queued for stable, many thanks!
Patch
--- tests/test-blackbox.t +++ tests/test-blackbox.t.err @@ -354,13 +354,13 @@ > EOF $ hg log --debug removing $TESTTMP/gone/.hg - warning: cannot write to blackbox.log: $ENOENT$ (no-windows !) warning: cannot write to blackbox.log: $TESTTMP/gone/.hg/blackbox.log: $ENOTDIR$ (windows !) $ cd .. blackbox should disable itself if track is empty $ hg --config blackbox.track= init nothing_tracked + warning: cannot write to blackbox.log: $ENOENT$ $ cd nothing_tracked $ cat >> .hg/hgrc << EOF > [blackbox] diff --git a/mercurial/dispatch.py b/mercurial/dispatch.py --- a/mercurial/dispatch.py +++ b/mercurial/dispatch.py @@ -323,7 +323,7 @@ def dispatch(req): ret = -1 finally: duration = util.timer() - starttime - req.ui.flush() + req.ui.flush() # record blocked times if req.ui.logblockedtimes: req.ui._blockedtimes[b'command_duration'] = duration * 1000 req.ui.log( @@ -346,6 +346,8 @@ def dispatch(req): req._runexithandlers() except: # exiting, so no re-raises ret = ret or -1 + # do flush again since ui.log() and exit handlers may write to ui + req.ui.flush() return ret