mercurial/dispatch.py
branchstable
changeset 45253 9b5723784aac
parent 45102 efcc87d37f4d
child 45678 bd2df58366b1
--- a/mercurial/dispatch.py	Sun Jul 26 12:46:04 2020 -0700
+++ b/mercurial/dispatch.py	Sat Jul 25 22:51:26 2020 +0900
@@ -323,7 +323,7 @@
             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 @@
                 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