static-http: have `statichttprepo.instance` return a peer object
authorPierre-Yves David <pierre-yves.david@octobus.net>
Tue, 29 Nov 2022 22:03:10 +0100
changeset 49690 c37287340c00
parent 49689 1863584f2fba
child 49691 c0acf5440fe1
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.
mercurial/hg.py
mercurial/statichttprepo.py
--- 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()