Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/httppeer.py @ 50786:758e40b9a8af stable
httppeer: fix static-http: scheme autodetection (issue6833)
Since statichttprepo.make_peer() assumes path is a urlutil.path object (by
accessing path.loc), we no longer can just provide a bytestring there.
See also 5f71fff8dc74 and cfe8d88a453e.
author | Anton Shestakov <av6@dwimlabs.net> |
---|---|
date | Thu, 05 Oct 2023 14:47:42 -0300 |
parents | 60f9602b413e |
children | 12c308c55e53 |
comparison
equal
deleted
inserted
replaced
50785:eccf7dc7c91e | 50786:758e40b9a8af |
---|---|
661 inst = _make_peer(ui, path, remotehidden=remotehidden) | 661 inst = _make_peer(ui, path, remotehidden=remotehidden) |
662 | 662 |
663 return inst | 663 return inst |
664 except error.RepoError as httpexception: | 664 except error.RepoError as httpexception: |
665 try: | 665 try: |
666 r = statichttprepo.make_peer(ui, b"static-" + path.loc, create) | 666 path = path.copy(new_raw_location=b"static-" + path.rawloc) |
667 r = statichttprepo.make_peer(ui, path, create) | |
667 ui.note(_(b'(falling back to static-http)\n')) | 668 ui.note(_(b'(falling back to static-http)\n')) |
668 return r | 669 return r |
669 except error.RepoError: | 670 except error.RepoError: |
670 raise httpexception # use the original http RepoError instead | 671 raise httpexception # use the original http RepoError instead |