diff mercurial/worker.py @ 30882:a91c62752d08 stable

worker: flush messages written by child processes before exit I found some child outputs were lost while testing the previous patch. Since os._exit() does nothing special, we need to do that explicitly.
author Yuya Nishihara <yuya@tcha.org>
date Sat, 25 Feb 2017 12:48:50 +0900
parents 18fb3cf572b4
children 13bbcd56c57a
line wrap: on
line diff
--- a/mercurial/worker.py	Sat Feb 25 12:33:37 2017 +0900
+++ b/mercurial/worker.py	Sat Feb 25 12:48:50 2017 +0900
@@ -148,12 +148,16 @@
             # may do some clean-ups which could cause surprises like deadlock.
             # see sshpeer.cleanup for example.
             try:
-                scmutil.callcatch(ui, workerfunc)
+                try:
+                    scmutil.callcatch(ui, workerfunc)
+                finally:
+                    ui.flush()
             except KeyboardInterrupt:
                 os._exit(255)
             except: # never return, therefore no re-raises
                 try:
                     ui.traceback()
+                    ui.flush()
                 finally:
                     os._exit(255)
             else: