From patchwork Sun Jul 17 20:01:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [1,of,2,V2] hgweb: store url of started server in instance variable From: Gregory Szorc X-Patchwork-Id: 15920 Message-Id: To: mercurial-devel@mercurial-scm.org Date: Sun, 17 Jul 2016 13:01:15 -0700 # HG changeset patch # User Gregory Szorc # Date 1468784698 25200 # Sun Jul 17 12:44:58 2016 -0700 # Node ID a6ed7328eac4500637021b9afa065225fe1b90ed # Parent 1c22400db72de4bbeb992fde534c0abbe1367b03 hgweb: store url of started server in instance variable To be used by the next patch. diff --git a/mercurial/hgweb/__init__.py b/mercurial/hgweb/__init__.py --- a/mercurial/hgweb/__init__.py +++ b/mercurial/hgweb/__init__.py @@ -73,18 +73,19 @@ class httpservice(object): fqaddr = self.httpd.fqaddr if ':' in fqaddr: fqaddr = '[%s]' % fqaddr if self.opts['port']: write = self.ui.status else: write = self.ui.write - write(_('listening at http://%s%s/%s (bound to %s:%d)\n') % - (fqaddr, port, prefix, bindaddr, self.httpd.port)) + self.url = 'http://%s%s/%s' % (fqaddr, port, prefix) + write(_('listening at %s (bound to %s:%d)\n') % + (self.url, bindaddr, self.httpd.port)) self.ui.flush() # avoid buffering of status message def run(self): self.httpd.serve_forever() def createservice(ui, repo, opts): # this way we can check if something was given in the command-line if opts.get('port'):