Patchwork [RFC] commands: No 'listening at' line when port specified (issue3976)

login
register
mail settings
Submitter Chinmay Joshi
Date March 20, 2014, 7:05 p.m.
Message ID <CAGwDGc1zoGdkpRG_651zVks9Ftkm0m+XXoUqJyk3cX97ZSQdWg@mail.gmail.com>
Download mbox | patch
Permalink /patch/4010/
State Superseded
Headers show

Comments

Chinmay Joshi - March 20, 2014, 7:05 p.m.
Hello!

This is my first attempt to for patch to mercurial or any other
project. This is what I have understood from contributing to mercurial
page. Forgive me and guide me in case of any discrepancy.

# HG changeset patch
# User hinmay Joshi <c@chinmayjoshi.com>
# Date 1395241845 -32400
#      Thu Mar 20 00:10:45 2014 +0900
# Node ID d666da075b912b7bae3c602842caed0e09b7235d
# Parent  7f7c8ef31c5d280cc0f0ecc823db675d3c6e60ee
commands: No 'listening at' line when port specified (issue3976)


When hg serve is executed with -p <port>,  there is no output with
"listening at host ...." but 'hg serve' does it. While this patch
provides the output but 43 tests fail because of used as 'hg serve -p
$HGPORT' in most of the test files.

Is it practical to add this line to output and modify all the test
files? Please guide me. Once again apologies for any inconvenience.

Chinmay Joshi

Patch

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/a/mercurial/commands.py
+++ b/b/mercurial/commands.py
@@ -5231,15 +5231,14 @@  class httpservice(object):
         self.httpd = hgweb_server.create_server(self.ui, self.app)

         if self.opts['port'] and not self.ui.verbose:
-            port = ":%d" % self.opts['port']
-        else:
-            port = ':%d' % self.httpd.port
+            return

         if self.httpd.prefix:
             prefix = self.httpd.prefix.strip('/') + '/'
         else:
             prefix = ''

+        port = ':%d' % self.httpd.port
         if port == ':80':
             port = ''