serve: make sure to print "listening at" message immediately
authorYuya Nishihara <yuya@tcha.org>
Sat, 28 Jun 2014 13:02:44 +0900
changeset 21817 6b0275e5f276
parent 21816 212955411633
child 21818 448714b79d9a
serve: make sure to print "listening at" message immediately If stdout is piped, status message won't be flushed until client connects to the server and access log is written to stdout. It seems bad idea to queue start-up banner of server process.
mercurial/commands.py
--- a/mercurial/commands.py	Fri Jun 27 15:20:50 2014 -0700
+++ b/mercurial/commands.py	Sat Jun 28 13:02:44 2014 +0900
@@ -5322,6 +5322,7 @@
             write = self.ui.write
         write(_('listening at http://%s%s/%s (bound to %s:%d)\n') %
               (fqaddr, port, prefix, bindaddr, self.httpd.port))
+        self.ui.flush()  # avoid buffering of status message
 
     def run(self):
         self.httpd.serve_forever()