[PATCH remotefilelog-ext build-fix] remotefilelog: handle the death of repo.sopener (hg change a69bb29b9638)

Augie Fackler raf at durin42.com
Tue Jun 30 09:16:09 CDT 2015


# HG changeset patch
# User Augie Fackler <augie at google.com>
# Date 1435673558 14400
#      Tue Jun 30 10:12:38 2015 -0400
# Node ID 0b1c8aee65839b5515c2a203d51b2d7fe9ed057b
# Parent  bd1a1e4e082d2c241f6d6bbc33bd4535d4103afd
remotefilelog: handle the death of repo.sopener (hg change a69bb29b9638)

repo.sopener has been deprecated since hg 2.3, and repo.svfs replaces
it. Since it's been dead for so long, let's just use svfs and call it
good enough.

diff --git a/remotefilelog/debugcommands.py b/remotefilelog/debugcommands.py
--- a/remotefilelog/debugcommands.py
+++ b/remotefilelog/debugcommands.py
@@ -52,7 +52,7 @@ def buildtemprevlog(repo, file):
     temppath = repo.sjoin('data/temprevlog.i')
     if os.path.exists(temppath):
         os.remove(temppath)
-    r = filelog.filelog(repo.sopener, 'temprevlog')
+    r = filelog.filelog(repo.svfs, 'temprevlog')
 
     class faket(object):
         def add(self, a,b,c):
diff --git a/remotefilelog/fileserverclient.py b/remotefilelog/fileserverclient.py
--- a/remotefilelog/fileserverclient.py
+++ b/remotefilelog/fileserverclient.py
@@ -273,7 +273,7 @@ class fileserverclient(object):
         """
         repo = self.repo
         localcache = self.localcache
-        storepath = repo.sopener.vfs.base
+        storepath = repo.svfs.vfs.base
         reponame = repo.name
         missingids = []
         for file, id in fileids:
diff --git a/remotefilelog/remotefilelogserver.py b/remotefilelog/remotefilelogserver.py
--- a/remotefilelog/remotefilelogserver.py
+++ b/remotefilelog/remotefilelogserver.py
@@ -43,7 +43,7 @@ def setupserver(ui, repo):
 
 onetime = False
 def onetimesetup(ui):
-    """Configures the wireprotocol for both clients and servers. 
+    """Configures the wireprotocol for both clients and servers.
     """
     global onetime
     if onetime:
@@ -177,7 +177,7 @@ def getfiles(repo, proto):
 
     def streamer():
         fin = proto.fin
-        opener = repo.sopener
+        opener = repo.svfs
 
         cachepath = repo.ui.config("remotefilelog", "servercachepath")
         if not cachepath:
@@ -202,7 +202,7 @@ def getfiles(repo, proto):
                 if not os.path.exists(filecachepath):
                     filectx = repo.filectx(path, fileid=node)
                     if filectx.node() == nullid:
-                        repo.changelog = changelog.changelog(repo.sopener)
+                        repo.changelog = changelog.changelog(repo.svfs)
                         filectx = repo.filectx(path, fileid=node)
 
                     text = createfileblob(filectx)
diff --git a/remotefilelog/shallowrepo.py b/remotefilelog/shallowrepo.py
--- a/remotefilelog/shallowrepo.py
+++ b/remotefilelog/shallowrepo.py
@@ -38,7 +38,7 @@ def wraprepo(repo):
                 f = f[1:]
 
             if self.shallowmatch(f):
-                return remotefilelog.remotefilelog(self.sopener, f, self)
+                return remotefilelog.remotefilelog(self.svfs, f, self)
             else:
                 return super(shallowrepository, self).file(f)
 
@@ -167,6 +167,6 @@ def wraprepo(repo):
         repo.shallowmatch = match.match(repo.root, '', None,
             repo.includepattern, repo.excludepattern)
 
-    localpath = os.path.join(repo.sopener.vfs.base, 'data')
+    localpath = os.path.join(repo.svfs.vfs.base, 'data')
     if not os.path.exists(localpath):
         os.makedirs(localpath)


More information about the Mercurial-devel mailing list