comparison mercurial/commands.py @ 1177:862f53c1d0f9

hg serve: print a more useful error message if server can't start.
author Bryan O'Sullivan <bos@serpentine.com>
date Wed, 31 Aug 2005 11:19:20 -0700
parents d32b91ebad5d
children 120aa5fc7ced
comparison
equal deleted inserted replaced
1176:ba4ce38b90a3 1177:862f53c1d0f9
1384 optlist = "name templates style address port ipv6 accesslog errorlog" 1384 optlist = "name templates style address port ipv6 accesslog errorlog"
1385 for o in optlist.split(): 1385 for o in optlist.split():
1386 if opts[o]: 1386 if opts[o]:
1387 ui.setconfig("web", o, opts[o]) 1387 ui.setconfig("web", o, opts[o])
1388 1388
1389 httpd = hgweb.create_server(repo) 1389 try:
1390 httpd = hgweb.create_server(repo)
1391 except socket.error, inst:
1392 raise util.Abort('cannot start server: ' + inst.args[1])
1390 1393
1391 if ui.verbose: 1394 if ui.verbose:
1392 addr, port = httpd.socket.getsockname() 1395 addr, port = httpd.socket.getsockname()
1393 if addr == '0.0.0.0': 1396 if addr == '0.0.0.0':
1394 addr = socket.gethostname() 1397 addr = socket.gethostname()