[PATCH] commandserver: flush ui before returning from runcommand

Yuya Nishihara yuya at tcha.org
Sat Mar 12 10:01:30 EST 2016


On Sat, 12 Mar 2016 05:12:11 +0000, Jun Wu wrote:
> # HG changeset patch
> # User Jun Wu <quark at fb.com>
> # Date 1457755658 0
> #      Sat Mar 12 04:07:38 2016 +0000
> # Node ID 9959a827322a48892aca4aa67c0b6adae394197f
> # Parent  82abdd91e22e218fbf17d032cbb15be72252fb28
> commandserver: flush ui before returning from runcommand
> 
> The client may exit after received the result from runcommand. It is necessary
> to do a flush to make sure the process waiting for the commandserver client
> will actually see the output after the commandserver client exits.
> 
> This helps chgserver pass test-alias.t.
> 
> diff --git a/mercurial/commandserver.py b/mercurial/commandserver.py
> --- a/mercurial/commandserver.py
> +++ b/mercurial/commandserver.py
> @@ -250,6 +250,10 @@
>          if '--cwd' in args:
>              os.chdir(self.cwd)
>  
> +        # flush output before returning result to client
> +        for ui in uis:
> +            ui.flush()

Perhaps this is a bug of dispatch. It appears dispatch._runcatch() tries to
flush output in some cases, but not always.


More information about the Mercurial-devel mailing list