Mercurial > public > mercurial-scm > hg-stable
comparison 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 |
comparison
equal
deleted
inserted
replaced
35457:44fd4cfc6c0a | 35458:786289423e97 |
---|---|
2221 | 2221 |
2222 source, branches = hg.parseurl(ui.expandpath(source)) | 2222 source, branches = hg.parseurl(ui.expandpath(source)) |
2223 url = util.url(source) | 2223 url = util.url(source) |
2224 addr = None | 2224 addr = None |
2225 | 2225 |
2226 if url.scheme == 'https': | 2226 defaultport = {'https': 443, 'ssh': 22} |
2227 addr = (url.host, url.port or 443) | 2227 if url.scheme in defaultport: |
2228 elif url.scheme == 'ssh': | 2228 try: |
2229 addr = (url.host, url.port or 22) | 2229 addr = (url.host, int(url.port or defaultport[url.scheme])) |
2230 except ValueError: | |
2231 raise error.Abort(_("malformed port number in URL")) | |
2230 else: | 2232 else: |
2231 raise error.Abort(_("only https and ssh connections are supported")) | 2233 raise error.Abort(_("only https and ssh connections are supported")) |
2232 | 2234 |
2233 from . import win32 | 2235 from . import win32 |
2234 | 2236 |