Submitter | Anurag Goel |
---|---|
Date | Feb. 19, 2014, 7:27 p.m. |
Message ID | <fdb4852286de396687f9.1392838040@ubuntu.ubuntu-domain> |
Download | mbox | patch |
Permalink | /patch/3698/ |
State | Superseded |
Headers | show |
Comments
On 2/19/14, 11:27 AM, "Anurag Goel" <anurag.dsps@gmail.com> wrote: >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 >+ you are making this a no-op. Remove the last part of the patch, there is no use to adding a bogus return statement at the end. I am not sure if we want to remove the condition at all, but for consistency I would say we should always display the listening at, even when we specified a port.
Yes, you are right. There is no of use last statement. Don't know how did I miss this thing. I will erase the last statement and send the revision version of this again. On Thu, Feb 20, 2014 at 1:11 AM, David Soria Parra <davidsp@fb.com> wrote: > > > On 2/19/14, 11:27 AM, "Anurag Goel" <anurag.dsps@gmail.com> wrote: > > >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 > >+ > > you are making this a no-op. Remove the last part of the patch, there is > no use to adding a bogus return statement at the end. > > I am not sure if we want to remove the condition at all, but for > consistency I would say we should always display > the listening at, even when we specified a port. > >
Patch
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()