vfs: drop text mode flag (API)
authorYuya Nishihara <yuya@tcha.org>
Sat, 13 Jan 2018 13:47:10 +0900
changeset 35625 390f860228ba
parent 35624 188b1371d1ed
child 35626 a0d33f4ddff9
vfs: drop text mode flag (API) It's useless on Python 3. .. api:: ``text=False|True`` option is dropped from the vfs interface because of Python 3 compatibility issue. Use ``util.tonativeeol/fromnativeeol()`` to convert EOL manually.
mercurial/vfs.py
--- a/mercurial/vfs.py	Sat Jan 13 13:41:11 2018 +0900
+++ b/mercurial/vfs.py	Sat Jan 13 13:47:10 2018 +0900
@@ -170,9 +170,9 @@
     def mkdir(self, path=None):
         return os.mkdir(self.join(path))
 
-    def mkstemp(self, suffix='', prefix='tmp', dir=None, text=False):
+    def mkstemp(self, suffix='', prefix='tmp', dir=None):
         fd, name = tempfile.mkstemp(suffix=suffix, prefix=prefix,
-                                    dir=self.join(dir), text=text)
+                                    dir=self.join(dir))
         dname, fname = util.split(name)
         if dir:
             return fd, os.path.join(dir, fname)
@@ -333,9 +333,8 @@
             return
         os.chmod(name, self.createmode & 0o666)
 
-    def __call__(self, path, mode="r", text=False, atomictemp=False,
-                 notindexed=False, backgroundclose=False, checkambig=False,
-                 auditpath=True):
+    def __call__(self, path, mode="r", atomictemp=False, notindexed=False,
+                 backgroundclose=False, checkambig=False, auditpath=True):
         '''Open ``path`` file, which is relative to vfs root.
 
         Newly created directories are marked as "not to be indexed by
@@ -373,7 +372,7 @@
             self.audit(path, mode=mode)
         f = self.join(path)
 
-        if not text and "b" not in mode:
+        if "b" not in mode:
             mode += "b" # for that other OS
 
         nlink = -1