Patchwork [3,of,5] clonebundle: use 'repo.vfs' instead of 'repo.opener'

login
register
mail settings
Submitter Pierre-Yves David
Date March 2, 2017, 2:58 a.m.
Message ID <dc2ae1022304ad29959c.1488423523@nodosa.octopoid.net>
Download mbox | patch
Permalink /patch/18868/
State Accepted
Headers show

Comments

Pierre-Yves David - March 2, 2017, 2:58 a.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@ens-lyon.org>
# Date 1488421398 -3600
#      Thu Mar 02 03:23:18 2017 +0100
# Node ID dc2ae1022304ad29959c52e1f549bb05472e9f43
# Parent  66df771e26f3e26aa2000b150427852fb8c88bf3
# EXP-Topic vfs.cleanup
clonebundle: use 'repo.vfs' instead of 'repo.opener'

The later is a 5 years old form.

Patch

diff --git a/hgext/clonebundles.py b/hgext/clonebundles.py
--- a/hgext/clonebundles.py
+++ b/hgext/clonebundles.py
@@ -177,7 +177,7 @@  def capabilities(orig, repo, proto):
     # Only advertise if a manifest exists. This does add some I/O to requests.
     # But this should be cheaper than a wasted network round trip due to
     # missing file.
-    if repo.opener.exists('clonebundles.manifest'):
+    if repo.vfs.exists('clonebundles.manifest'):
         caps.append('clonebundles')
 
     return caps
diff --git a/mercurial/wireproto.py b/mercurial/wireproto.py
--- a/mercurial/wireproto.py
+++ b/mercurial/wireproto.py
@@ -736,7 +736,7 @@  def clonebundles(repo, proto):
     depending on the request. e.g. you could advertise URLs for the closest
     data center given the client's IP address.
     """
-    return repo.opener.tryread('clonebundles.manifest')
+    return repo.vfs.tryread('clonebundles.manifest')
 
 wireprotocaps = ['lookup', 'changegroupsubset', 'branchmap', 'pushkey',
                  'known', 'getbundle', 'unbundlehash', 'batch']