Patchwork [V3] dispatch: flush ui before returning from dispatch

login
register
mail settings
Submitter Jun Wu
Date March 16, 2016, 12:05 p.m.
Message ID <5becd975aa2bd1945471.1458129933@x1c>
Download mbox | patch
Permalink /patch/13910/
State Accepted
Delegated to: Yuya Nishihara
Headers show

Comments

Jun Wu - March 16, 2016, 12:05 p.m.
# HG changeset patch
# User Jun Wu <quark@fb.com>
# Date 1457953594 0
#      Mon Mar 14 11:06:34 2016 +0000
# Node ID 5becd975aa2bd1945471c997f9c6a2738bc96568
# Parent  4c950800184ec1e943967d3ed4a410a4f700d900
dispatch: flush ui before returning from dispatch

A chg client may exit after received the result from runcommand. It is
necessary to do a flush to make sure the warning message is printed out
and the process waiting for the chg client will actually see the output.

This helps chg to pass test-alias.t.
Yuya Nishihara - March 16, 2016, 2:41 p.m.
On Wed, 16 Mar 2016 12:05:33 +0000, Jun Wu wrote:
> # HG changeset patch
> # User Jun Wu <quark@fb.com>
> # Date 1457953594 0
> #      Mon Mar 14 11:06:34 2016 +0000
> # Node ID 5becd975aa2bd1945471c997f9c6a2738bc96568
> # Parent  4c950800184ec1e943967d3ed4a410a4f700d900
> dispatch: flush ui before returning from dispatch

Pushed to the clowncopter, thanks.

Patch

diff --git a/mercurial/dispatch.py b/mercurial/dispatch.py
--- a/mercurial/dispatch.py
+++ b/mercurial/dispatch.py
@@ -129,6 +129,7 @@ 
         ret = -1
     finally:
         duration = time.time() - starttime
+        req.ui.flush()
         req.ui.log("commandfinish", "%s exited %s after %0.2f seconds\n",
                    msg, ret or 0, duration)
     return ret