##// END OF EJS Templates
merge: move some of the logic in batchget() to workingfilectx...
Phil Cohen -
r34039:65ae5458 default
parent child Browse files
Show More
@@ -1963,6 +1963,14 b' class workingfilectx(committablefilectx)'
1963 self._repo.wwrite(self._path, data, flags,
1963 self._repo.wwrite(self._path, data, flags,
1964 backgroundclose=backgroundclose)
1964 backgroundclose=backgroundclose)
1965
1965
1966 def clearunknown(self):
1967 """Removes conflicting items in the working directory so that
1968 ``write()`` can be called successfully.
1969 """
1970 wvfs = self._repo.wvfs
1971 if wvfs.isdir(self._path) and not wvfs.islink(self._path):
1972 wvfs.removedirs(self._path)
1973
1966 def setflags(self, l, x):
1974 def setflags(self, l, x):
1967 self._repo.wvfs.setflags(self._path, l, x)
1975 self._repo.wvfs.setflags(self._path, l, x)
1968
1976
@@ -1150,9 +1150,7 b' def batchget(repo, mctx, wctx, actions):'
1150 except OSError as e:
1150 except OSError as e:
1151 if e.errno != errno.ENOENT:
1151 if e.errno != errno.ENOENT:
1152 raise
1152 raise
1153
1153 wctx[f].clearunknown()
1154 if repo.wvfs.isdir(f) and not repo.wvfs.islink(f):
1155 repo.wvfs.removedirs(f)
1156 wctx[f].write(fctx(f).data(), flags, backgroundclose=True)
1154 wctx[f].write(fctx(f).data(), flags, backgroundclose=True)
1157 if i == 100:
1155 if i == 100:
1158 yield i, f
1156 yield i, f
General Comments 0
You need to be logged in to leave comments. Login now