Mercurial > hg
changeset 21717:2a095d3442e0
patch: replace functions in fsbackend to use vfs
Several functions in fsbackend are replaced to use vfs functions.
vfs operations are applied on filename and path is joined by _join().
author | Chinmay Joshi <c@chinmayjoshi.com> |
---|---|
date | Thu, 05 Jun 2014 15:24:29 +0530 |
parents | 90f9be5adade |
children | bc773e9505e3 |
files | mercurial/patch.py |
diffstat | 1 files changed, 8 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/patch.py Thu Jun 05 15:16:44 2014 +0530 +++ b/mercurial/patch.py Thu Jun 05 15:24:29 2014 +0530 @@ -417,12 +417,12 @@ return os.path.join(self.opener.base, f) def getfile(self, fname): - path = self._join(fname) - if os.path.islink(path): - return (os.readlink(path), (True, False)) + if self.opener.islink(fname): + return (self.opener.readlink(fname), (True, False)) + isexec = False try: - isexec = os.lstat(path).st_mode & 0100 != 0 + isexec = self.opener.lstat(fname).st_mode & 0100 != 0 except OSError, e: if e.errno != errno.ENOENT: raise @@ -431,17 +431,17 @@ def setfile(self, fname, data, mode, copysource): islink, isexec = mode if data is None: - util.setflags(self._join(fname), islink, isexec) + self.opener.setflags(fname, islink, isexec) return if islink: self.opener.symlink(data, fname) else: self.opener.write(fname, data) if isexec: - util.setflags(self._join(fname), False, True) + self.opener.setflags(fname, False, True) def unlink(self, fname): - util.unlinkpath(self._join(fname), ignoremissing=True) + self.opener.unlinkpath(fname, ignoremissing=True) def writerej(self, fname, failed, total, lines): fname = fname + ".rej" @@ -453,7 +453,7 @@ fp.close() def exists(self, fname): - return os.path.lexists(self._join(fname)) + return self.opener.lexists(fname) class workingbackend(fsbackend): def __init__(self, ui, repo, similarity):