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

Kevin Bullock kbullock+mercurial at ringworld.org
Thu Mar 20 22:01:45 CDT 2014


On Mar 20, 2014, at 2:05 PM, Chinmay Joshi <c at chinmayjoshi.com> wrote:

> 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 at 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)

This is a good start. Some style nits: lowercase 'n' in 'no' -- except that your summary line should say what the patch changes, not what the issue was.

> 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.

If all of the changed test output is a correct result of the bug being fixed, then yes, you should update all the test output. run-tests has a -i/--interactive flag that will help you make these changes faster. You might also consider changing most (but not all!) of the affected test lines not to use --verbose if they don't otherwise need to.

I can't comment on your patch because it doesn't apply.

> 
> 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 = ''
> 
> Chinmay Joshi
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel

pacem in terris / мир / शान्ति / ‎‫سَلاَم‬ / 平和
Kevin R. Bullock



More information about the Mercurial-devel mailing list