Mercurial > public > mercurial-scm > hg
diff mercurial/commands.py @ 12076:49463314c24f
mail/hgweb: support service names for ports (issue2350)
This adds util.getport(port) which tries to parse port as an int, and
failing that, looks it up using socket.getservbyname(). Thus, the
following will work:
[smtp]
port = submission
[web]
port = http
This does not apply to ports in URLs used in clone, pull, etc.
author | Brodie Rao <brodie@bitheap.org> |
---|---|
date | Sat, 28 Aug 2010 12:31:07 -0400 |
parents | fddacca3202e |
children | ff7c1118a83a |
line wrap: on
line diff
--- a/mercurial/commands.py Fri Aug 27 16:25:47 2010 +0200 +++ b/mercurial/commands.py Sat Aug 28 12:31:07 2010 -0400 @@ -3332,7 +3332,7 @@ # this way we can check if something was given in the command-line if opts.get('port'): - opts['port'] = int(opts.get('port')) + opts['port'] = util.getport(opts.get('port')) baseui = repo and repo.baseui or ui optlist = ("name templates style address port prefix ipv6"