Mercurial > public > mercurial-scm > hg
comparison mercurial/commands.py @ 10635:27027bee318e
serve: fix port config
author | Benoit Boissinot <benoit.boissinot@ens-lyon.org> |
---|---|
date | Wed, 10 Mar 2010 22:27:42 +0100 |
parents | 54fb6e1fafe6 |
children | 63948e7d37f7 |
comparison
equal
deleted
inserted
replaced
10634:768c76f0b4c8 | 10635:27027bee318e |
---|---|
2878 if repo is None: | 2878 if repo is None: |
2879 raise error.RepoError(_("There is no Mercurial repository here" | 2879 raise error.RepoError(_("There is no Mercurial repository here" |
2880 " (.hg not found)")) | 2880 " (.hg not found)")) |
2881 s = sshserver.sshserver(ui, repo) | 2881 s = sshserver.sshserver(ui, repo) |
2882 s.serve_forever() | 2882 s.serve_forever() |
2883 | |
2884 # this way we can check if something was given in the command-line | |
2885 if opts.get('port'): | |
2886 opts['port'] = int(opts.get('port')) | |
2883 | 2887 |
2884 baseui = repo and repo.baseui or ui | 2888 baseui = repo and repo.baseui or ui |
2885 optlist = ("name templates style address port prefix ipv6" | 2889 optlist = ("name templates style address port prefix ipv6" |
2886 " accesslog errorlog webdir_conf certificate encoding") | 2890 " accesslog errorlog webdir_conf certificate encoding") |
2887 for o in optlist.split(): | 2891 for o in optlist.split(): |
3779 (serve, | 3783 (serve, |
3780 [('A', 'accesslog', '', _('name of access log file to write to')), | 3784 [('A', 'accesslog', '', _('name of access log file to write to')), |
3781 ('d', 'daemon', None, _('run server in background')), | 3785 ('d', 'daemon', None, _('run server in background')), |
3782 ('', 'daemon-pipefds', '', _('used internally by daemon mode')), | 3786 ('', 'daemon-pipefds', '', _('used internally by daemon mode')), |
3783 ('E', 'errorlog', '', _('name of error log file to write to')), | 3787 ('E', 'errorlog', '', _('name of error log file to write to')), |
3784 ('p', 'port', 8000, _('port to listen on')), | 3788 # use string type, then we can check if something was passed |
3789 ('p', 'port', '', _('port to listen on (default: 8000')), | |
3785 ('a', 'address', '', | 3790 ('a', 'address', '', |
3786 _('address to listen on (default: all interfaces)')), | 3791 _('address to listen on (default: all interfaces)')), |
3787 ('', 'prefix', '', | 3792 ('', 'prefix', '', |
3788 _('prefix path to serve from (default: server root)')), | 3793 _('prefix path to serve from (default: server root)')), |
3789 ('n', 'name', '', | 3794 ('n', 'name', '', |