# HG changeset patch # User Benoit Boissinot # Date 1268256462 -3600 # Node ID 27027bee318e44a5d142f603c7e1dad5e956e478 # Parent 768c76f0b4c87c325b14b01f2d3c9f420aa81500 serve: fix port config diff -r 768c76f0b4c8 -r 27027bee318e mercurial/commands.py --- a/mercurial/commands.py Wed Mar 10 22:07:38 2010 +0100 +++ b/mercurial/commands.py Wed Mar 10 22:27:42 2010 +0100 @@ -2881,6 +2881,10 @@ s = sshserver.sshserver(ui, repo) s.serve_forever() + # this way we can check if something was given in the command-line + if opts.get('port'): + opts['port'] = int(opts.get('port')) + baseui = repo and repo.baseui or ui optlist = ("name templates style address port prefix ipv6" " accesslog errorlog webdir_conf certificate encoding") @@ -3781,7 +3785,8 @@ ('d', 'daemon', None, _('run server in background')), ('', 'daemon-pipefds', '', _('used internally by daemon mode')), ('E', 'errorlog', '', _('name of error log file to write to')), - ('p', 'port', 8000, _('port to listen on')), + # use string type, then we can check if something was passed + ('p', 'port', '', _('port to listen on (default: 8000')), ('a', 'address', '', _('address to listen on (default: all interfaces)')), ('', 'prefix', '',