[PATCH] serve: No 'listening at' line when port specified (issue 3976)

Anurag Goel anurag.dsps at gmail.com
Wed Feb 19 13:27:20 CST 2014


# HG changeset patch
# User anuraggoel <anurag.dsps at gmail.com>
# Date 1392837899 -19800
#      Thu Feb 20 00:54:59 2014 +0530
# Node ID fdb4852286de396687f9fdbbb5ffadb376ca8394
# Parent  76c749d59a82462328f194708c63259d61fc32f1
serve: No 'listening at' line when port specified (issue 3976)

When port is specified in "hg serve" command,then there is no listening.
This problem arise when ui.verbose is not configured which simply return the function value in mid-way.
By the writing this "ui.verbose condition" at the end of function lets function callee to go through whole function.
Now it gives message to the user "listening at port some number".
I run the test suite.Its working fine except that new line when port is specified.
We need to add one line in test suite wherever port is specified.

diff -r 76c749d59a82 -r fdb4852286de mercurial/commands.py
--- a/mercurial/commands.py	Sat Feb 15 23:58:54 2014 +0530
+++ b/mercurial/commands.py	Thu Feb 20 00:54:59 2014 +0530
@@ -5232,9 +5232,6 @@
         util.setsignalhandler()
         self.httpd = hgweb_server.create_server(self.ui, self.app)
 
-        if self.opts['port'] and not self.ui.verbose:
-            return
-
         if self.httpd.prefix:
             prefix = self.httpd.prefix.strip('/') + '/'
         else:
@@ -5260,6 +5257,9 @@
         write(_('listening at http://%s%s/%s (bound to %s:%d)\n') %
               (fqaddr, port, prefix, bindaddr, self.httpd.port))
 
+        if self.opts['port'] and not self.ui.verbose:
+            return
+
     def run(self):
         self.httpd.serve_forever()
 


More information about the Mercurial-devel mailing list