[PATCH 1 of 2 V2] hgweb: store url of started server in instance variable

Gregory Szorc gregory.szorc at gmail.com
Sun Jul 17 16:01:15 EDT 2016


# HG changeset patch
# User Gregory Szorc <gregory.szorc at gmail.com>
# 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'):


More information about the Mercurial-devel mailing list