[PATCH] commandserver: flush ui before returning from runcommand

Jun Wu quark at fb.com
Sat Mar 12 00:12:11 EST 2016


# 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()
+
         self.cresult.write(struct.pack('>i', int(ret)))
 
     def getencoding(self):


More information about the Mercurial-devel mailing list