--- 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', '',