diff mercurial/commands.py @ 5970:f25070ecf334

hgweb: fixes to make hg serve prefix handling more robust
author Michele Cella <michele.cella@gmail.com>
date Tue, 22 Jan 2008 22:13:29 +0100
parents e7f1be4bf40a
children a445388aa554
line wrap: on
line diff
--- a/mercurial/commands.py	Thu Jan 31 14:44:00 2008 -0600
+++ b/mercurial/commands.py	Tue Jan 22 22:13:29 2008 +0100
@@ -2418,11 +2418,17 @@
 
             if not ui.verbose: return
 
+            if self.httpd.prefix:
+                prefix = self.httpd.prefix.strip('/') + '/'
+            else:
+                prefix = ''
+
             if self.httpd.port != 80:
-                ui.status(_('listening at http://%s:%d/\n') %
-                          (self.httpd.addr, self.httpd.port))
+                ui.status(_('listening at http://%s:%d/%s\n') %
+                          (self.httpd.addr, self.httpd.port, prefix))
             else:
-                ui.status(_('listening at http://%s/\n') % self.httpd.addr)
+                ui.status(_('listening at http://%s/%s\n') % 
+                          (self.httpd.addr, prefix))
 
         def run(self):
             self.httpd.serve_forever()