changeset 7845:c2cd8d772805

zeroconf: advertise repositories with hostname
author Alexander Solovyov <piranha@piranha.org.ua>
date Thu, 05 Mar 2009 12:58:13 +0200
parents dd73860c6059
children 1cb6836946be
files hgext/zeroconf/__init__.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/zeroconf/__init__.py	Mon Mar 16 17:56:50 2009 -0500
+++ b/hgext/zeroconf/__init__.py	Thu Mar 05 12:58:13 2009 +0200
@@ -77,8 +77,9 @@
         ip = getip()
         localip = socket.inet_aton(ip)
 
-    parts = socket.gethostname().split('.')
-    host = parts[0] + ".local"
+    hostname = socket.gethostname().split('.')[0]
+    host = hostname + ".local"
+    name = "%s-%s" % (hostname, name)
 
     # advertise to browsers
     svc = Zeroconf.ServiceInfo('_http._tcp.local.',