diff mercurial/httppeer.py @ 50990: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
line wrap: on
line diff
--- a/mercurial/httppeer.py	Thu Sep 14 10:52:09 2023 +0100
+++ b/mercurial/httppeer.py	Thu Oct 05 14:47:42 2023 -0300
@@ -663,7 +663,8 @@
         return inst
     except error.RepoError as httpexception:
         try:
-            r = statichttprepo.make_peer(ui, b"static-" + path.loc, create)
+            path = path.copy(new_raw_location=b"static-" + path.rawloc)
+            r = statichttprepo.make_peer(ui, path, create)
             ui.note(_(b'(falling back to static-http)\n'))
             return r
         except error.RepoError: