changeset 23878:37a92908a382

localrepo: remove all external users of localrepo.sopener This change touches every module in which repository.sopener was being used, and changes it for the equivalent repository.svfs. It should now be possible to remove localrepo.sopener.
author Angel Ezquerra <angel.ezquerra@gmail.com>
date Sun, 11 Jan 2015 00:25:54 +0100
parents 7cc77030c557
children b88278a308c6
files contrib/perf.py hgext/keyword.py mercurial/bundlerepo.py mercurial/phases.py mercurial/repair.py mercurial/statichttprepo.py mercurial/unionrepo.py mercurial/wireproto.py
diffstat 8 files changed, 21 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/perf.py	Thu Jan 15 23:17:12 2015 +0100
+++ b/contrib/perf.py	Sun Jan 11 00:25:54 2015 +0100
@@ -129,8 +129,8 @@
     import mercurial.manifest
     timer, fm = gettimer(ui)
     def t():
-        repo.changelog = mercurial.changelog.changelog(repo.sopener)
-        repo.manifest = mercurial.manifest.manifest(repo.sopener)
+        repo.changelog = mercurial.changelog.changelog(repo.svfs)
+        repo.manifest = mercurial.manifest.manifest(repo.svfs)
         repo._tags = None
         return len(repo.tags())
     timer(t)
@@ -269,7 +269,7 @@
     mercurial.revlog._prereadsize = 2**24 # disable lazy parser in old hg
     n = repo["tip"].node()
     def d():
-        cl = mercurial.revlog.revlog(repo.sopener, "00changelog.i")
+        cl = mercurial.revlog.revlog(repo.svfs, "00changelog.i")
         cl.rev(n)
     timer(d)
     fm.end()
@@ -312,7 +312,7 @@
     import mercurial.revlog
     mercurial.revlog._prereadsize = 2**24 # disable lazy parser in old hg
     n = repo[rev].node()
-    cl = mercurial.revlog.revlog(repo.sopener, "00changelog.i")
+    cl = mercurial.revlog.revlog(repo.svfs, "00changelog.i")
     def d():
         cl.rev(n)
         clearcaches(cl)
@@ -537,5 +537,5 @@
 
     Result is the number of markers in the repo."""
     timer, fm = gettimer(ui)
-    timer(lambda: len(obsolete.obsstore(repo.sopener)))
+    timer(lambda: len(obsolete.obsstore(repo.svfs)))
     fm.end()
--- a/hgext/keyword.py	Thu Jan 15 23:17:12 2015 +0100
+++ b/hgext/keyword.py	Sun Jan 11 00:25:54 2015 +0100
@@ -591,7 +591,7 @@
         def file(self, f):
             if f[0] == '/':
                 f = f[1:]
-            return kwfilelog(self.sopener, kwt, f)
+            return kwfilelog(self.svfs, kwt, f)
 
         def wread(self, filename):
             data = super(kwrepo, self).wread(filename)
--- a/mercurial/bundlerepo.py	Thu Jan 15 23:17:12 2015 +0100
+++ b/mercurial/bundlerepo.py	Sun Jan 11 00:25:54 2015 +0100
@@ -254,7 +254,7 @@
     def changelog(self):
         # consume the header if it exists
         self.bundle.changelogheader()
-        c = bundlechangelog(self.sopener, self.bundle)
+        c = bundlechangelog(self.svfs, self.bundle)
         self.manstart = self.bundle.tell()
         return c
 
@@ -263,7 +263,7 @@
         self.bundle.seek(self.manstart)
         # consume the header if it exists
         self.bundle.manifestheader()
-        m = bundlemanifest(self.sopener, self.bundle, self.changelog.rev)
+        m = bundlemanifest(self.svfs, self.bundle, self.changelog.rev)
         self.filestart = self.bundle.tell()
         return m
 
@@ -296,10 +296,10 @@
 
         if f in self.bundlefilespos:
             self.bundle.seek(self.bundlefilespos[f])
-            return bundlefilelog(self.sopener, f, self.bundle,
+            return bundlefilelog(self.svfs, f, self.bundle,
                                  self.changelog.rev, self)
         else:
-            return filelog.filelog(self.sopener, f)
+            return filelog.filelog(self.svfs, f)
 
     def close(self):
         """Close assigned bundle file immediately."""
--- a/mercurial/phases.py	Thu Jan 15 23:17:12 2015 +0100
+++ b/mercurial/phases.py	Sun Jan 11 00:25:54 2015 +0100
@@ -133,7 +133,7 @@
                 if inst.errno != errno.ENOENT:
                     raise
         if f is None:
-            f = repo.sopener('phaseroots')
+            f = repo.svfs('phaseroots')
         try:
             for line in f:
                 phase, nh = line.split()
@@ -156,7 +156,7 @@
             self.phaseroots, self.dirty = _readroots(repo, phasedefaults)
             self._phaserevs = None
             self.filterunknown(repo)
-            self.opener = repo.sopener
+            self.opener = repo.svfs
 
     def copy(self):
         # Shallow copy meant to ensure isolation in
--- a/mercurial/repair.py	Thu Jan 15 23:17:12 2015 +0100
+++ b/mercurial/repair.py	Sun Jan 11 00:25:54 2015 +0100
@@ -148,7 +148,7 @@
         try:
             for i in xrange(offset, len(tr.entries)):
                 file, troffset, ignore = tr.entries[i]
-                repo.sopener(file, 'a').truncate(troffset)
+                repo.svfs(file, 'a').truncate(troffset)
                 if troffset == 0:
                     repo.store.markremoved(file)
             tr.close()
--- a/mercurial/statichttprepo.py	Thu Jan 15 23:17:12 2015 +0100
+++ b/mercurial/statichttprepo.py	Sun Jan 11 00:25:54 2015 +0100
@@ -130,14 +130,14 @@
         # setup store
         self.store = store.store(requirements, self.path, opener)
         self.spath = self.store.path
-        self.sopener = self.store.opener
-        self.svfs = self.sopener
+        self.svfs = self.store.opener
+        self.sopener = self.svfs
         self.sjoin = self.store.join
         self._filecache = {}
         self.requirements = requirements
 
-        self.manifest = manifest.manifest(self.sopener)
-        self.changelog = changelog.changelog(self.sopener)
+        self.manifest = manifest.manifest(self.svfs)
+        self.changelog = changelog.changelog(self.svfs)
         self._tags = None
         self.nodetagscache = None
         self._branchcaches = {}
--- a/mercurial/unionrepo.py	Thu Jan 15 23:17:12 2015 +0100
+++ b/mercurial/unionrepo.py	Sun Jan 11 00:25:54 2015 +0100
@@ -178,7 +178,7 @@
 
     @localrepo.unfilteredpropertycache
     def changelog(self):
-        return unionchangelog(self.sopener, self.repo2.sopener)
+        return unionchangelog(self.svfs, self.repo2.svfs)
 
     def _clrev(self, rev2):
         """map from repo2 changelog rev to temporary rev in self.changelog"""
@@ -187,14 +187,14 @@
 
     @localrepo.unfilteredpropertycache
     def manifest(self):
-        return unionmanifest(self.sopener, self.repo2.sopener,
+        return unionmanifest(self.svfs, self.repo2.svfs,
                              self._clrev)
 
     def url(self):
         return self._url
 
     def file(self, f):
-        return unionfilelog(self.sopener, f, self.repo2.sopener,
+        return unionfilelog(self.svfs, f, self.repo2.svfs,
                             self._clrev, self)
 
     def close(self):
--- a/mercurial/wireproto.py	Thu Jan 15 23:17:12 2015 +0100
+++ b/mercurial/wireproto.py	Sun Jan 11 00:25:54 2015 +0100
@@ -782,7 +782,7 @@
                       (len(entries), total_bytes))
         yield '%d %d\n' % (len(entries), total_bytes)
 
-        sopener = repo.sopener
+        sopener = repo.svfs
         oldaudit = sopener.mustaudit
         debugflag = repo.ui.debugflag
         sopener.mustaudit = False