changeset 49690:c37287340c00

static-http: have `statichttprepo.instance` return a peer object It previously returned a statichttprepo object which could not be used for anything but creating a peer. So lets put it into the peer bucket with a peer behavior.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 29 Nov 2022 22:03:10 +0100
parents 1863584f2fba
children c0acf5440fe1
files mercurial/hg.py mercurial/statichttprepo.py
diffstat 2 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hg.py	Wed Nov 30 12:22:02 2022 +0100
+++ b/mercurial/hg.py	Tue Nov 29 22:03:10 2022 +0100
@@ -147,13 +147,13 @@
     b'bundle': bundlerepo,
     b'union': unionrepo,
     b'file': LocalFactory,
-    b'static-http': statichttprepo,
 }
 
 peer_schemes = {
     b'http': httppeer,
     b'https': httppeer,
     b'ssh': sshpeer,
+    b'static-http': statichttprepo,
 }
 
 
--- a/mercurial/statichttprepo.py	Wed Nov 30 12:22:02 2022 +0100
+++ b/mercurial/statichttprepo.py	Tue Nov 29 22:03:10 2022 +0100
@@ -262,4 +262,4 @@
 def instance(ui, path, create, intents=None, createopts=None):
     if create:
         raise error.Abort(_(b'cannot create new static-http repository'))
-    return statichttprepository(ui, path[7:])
+    return statichttprepository(ui, path[7:]).peer()