Mercurial > public > mercurial-scm > hg-stable
diff mercurial/debugcommands.py @ 35458:786289423e97
merge with stable
author | Augie Fackler <augie@google.com> |
---|---|
date | Tue, 19 Dec 2017 16:27:24 -0500 |
parents | 8251c4c4abdc 88572b7e50fd |
children | 3bb1a647ab42 |
line wrap: on
line diff
--- a/mercurial/debugcommands.py Mon Dec 18 15:18:37 2017 -0800 +++ b/mercurial/debugcommands.py Tue Dec 19 16:27:24 2017 -0500 @@ -2223,10 +2223,12 @@ url = util.url(source) addr = None - if url.scheme == 'https': - addr = (url.host, url.port or 443) - elif url.scheme == 'ssh': - addr = (url.host, url.port or 22) + defaultport = {'https': 443, 'ssh': 22} + if url.scheme in defaultport: + try: + addr = (url.host, int(url.port or defaultport[url.scheme])) + except ValueError: + raise error.Abort(_("malformed port number in URL")) else: raise error.Abort(_("only https and ssh connections are supported"))