Patchwork [5,of,6,RFC] localrepo: remove all internal uses of localrepo.wopener

login
register
mail settings
Submitter Angel Ezquerra
Date Jan. 11, 2015, 1:20 a.m.
Message ID <2911bce490c6310a2fa2.1420939254@Angels-MacBook-Pro.local>
Download mbox | patch
Permalink /patch/7432/
State Accepted
Commit f6070d3a9cb89a50ae3112f7c3d22f4ccc5c4db7
Headers show

Comments

Angel Ezquerra - Jan. 11, 2015, 1:20 a.m.
# HG changeset patch
# User Angel Ezquerra <angel.ezquerra@gmail.com>
# Date 1420936356 -3600
#      Sun Jan 11 01:32:36 2015 +0100
# Node ID 2911bce490c6310a2fa2ffb8ad7a9d061d212852
# Parent  fcc635af6d5d6762694b57016d27c7d8905bb4c7
localrepo: remove all internal uses of localrepo.wopener

It has been replaced with localrepo.wvfs.
Matt Mackall - Jan. 14, 2015, 11:52 p.m.
On Sun, 2015-01-11 at 02:20 +0100, Angel Ezquerra wrote:
> # HG changeset patch
> # User Angel Ezquerra <angel.ezquerra@gmail.com>
> # Date 1420936356 -3600
> #      Sun Jan 11 01:32:36 2015 +0100
> # Node ID 2911bce490c6310a2fa2ffb8ad7a9d061d212852
> # Parent  fcc635af6d5d6762694b57016d27c7d8905bb4c7
> localrepo: remove all internal uses of localrepo.wopener
> 
> It has been replaced with localrepo.wvfs.

I'm taking 1, 3, and 5 for now.

Patch

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -818,7 +818,7 @@ 
         return self.dirstate.pathto(f, cwd)
 
     def wfile(self, f, mode='r'):
-        return self.wopener(f, mode)
+        return self.wvfs(f, mode)
 
     def _link(self, f):
         return self.wvfs.islink(f)
@@ -871,15 +871,15 @@ 
         if self._link(filename):
             data = self.wvfs.readlink(filename)
         else:
-            data = self.wopener.read(filename)
+            data = self.wvfs.read(filename)
         return self._filter(self._encodefilterpats, filename, data)
 
     def wwrite(self, filename, data, flags):
         data = self._filter(self._decodefilterpats, filename, data)
         if 'l' in flags:
-            self.wopener.symlink(data, filename)
+            self.wvfs.symlink(data, filename)
         else:
-            self.wopener.write(filename, data)
+            self.wvfs.write(filename, data)
             if 'x' in flags:
                 self.wvfs.setflags(filename, False, True)