clone-bundle: rename the methods and wireprotole command
authorPierre-Yves David <pierre-yves.david@octobus.net>
Mon, 19 Jun 2023 11:04:27 +0200
changeset 50699 2aaabd8f4471
parent 50698 f1b57672cb94
child 50700 f4e8c82e2cef
clone-bundle: rename the methods and wireprotole command The current naming is very clone centric, since then, the url scheme was moved to a more generic wording to make room for other use-cases (e.g. pull bundles). We apply the same logic to the internal API and, very important prior to the release, to the wire protocol command.
mercurial/exchange.py
mercurial/interfaces/repository.py
mercurial/localrepo.py
mercurial/wireprotov1peer.py
mercurial/wireprotov1server.py
--- a/mercurial/exchange.py	Sun Jun 18 00:04:53 2023 +0200
+++ b/mercurial/exchange.py	Mon Jun 19 11:04:27 2023 +0200
@@ -2859,7 +2859,7 @@
     if not peer:
         raise error.Abort(_(b'no remote repository supplied for %s' % url))
     clonebundleid = url[len(bundlecaches.CLONEBUNDLESCHEME) :]
-    peerclonebundle = peer.get_inline_clone_bundle(clonebundleid)
+    peerclonebundle = peer.get_cached_bundle_inline(clonebundleid)
     return util.chunkbuffer(peerclonebundle)
 
 
--- a/mercurial/interfaces/repository.py	Sun Jun 18 00:04:53 2023 +0200
+++ b/mercurial/interfaces/repository.py	Mon Jun 19 11:04:27 2023 +0200
@@ -176,8 +176,8 @@
         Returns a set of string capabilities.
         """
 
-    def get_inline_clone_bundle(path):
-        """Retrieve clonebundle across the wire.
+    def get_cached_bundle_inline(path):
+        """Retrieve a clonebundle across the wire.
 
         Returns a chunkbuffer
         """
--- a/mercurial/localrepo.py	Sun Jun 18 00:04:53 2023 +0200
+++ b/mercurial/localrepo.py	Mon Jun 19 11:04:27 2023 +0200
@@ -348,7 +348,7 @@
     def capabilities(self):
         return self._caps
 
-    def get_inline_clone_bundle(self, path):
+    def get_cached_bundle_inline(self, path):
         # not needed with local peer
         raise NotImplementedError
 
--- a/mercurial/wireprotov1peer.py	Sun Jun 18 00:04:53 2023 +0200
+++ b/mercurial/wireprotov1peer.py	Mon Jun 19 11:04:27 2023 +0200
@@ -344,8 +344,8 @@
     def _finish_inline_clone_bundle(self, stream):
         pass  # allow override for httppeer
 
-    def get_inline_clone_bundle(self, path):
-        stream = self._callstream(b"get_inline_clone_bundle", path=path)
+    def get_cached_bundle_inline(self, path):
+        stream = self._callstream(b"get_cached_bundle_inline", path=path)
         length = util.uvarintdecodestream(stream)
 
         # SSH streams will block if reading more than length
--- a/mercurial/wireprotov1server.py	Sun Jun 18 00:04:53 2023 +0200
+++ b/mercurial/wireprotov1server.py	Mon Jun 19 11:04:27 2023 +0200
@@ -265,8 +265,8 @@
     return wireprototypes.bytesresponse(b''.join(r))
 
 
-@wireprotocommand(b'get_inline_clone_bundle', b'path', permission=b'pull')
-def get_inline_clone_bundle(repo, proto, path):
+@wireprotocommand(b'get_cached_bundle_inline', b'path', permission=b'pull')
+def get_cached_bundle_inline(repo, proto, path):
     """
     Server command to send a clonebundle to the client
     """