localrepo: support background closing for wwrite()
authorGregory Szorc <gregory.szorc@gmail.com>
Sat, 20 Feb 2016 15:25:27 -0800
changeset 28198 ddc07ddcca94
parent 28197 2ada62388bb1
child 28199 d49793aac1ac
localrepo: support background closing for wwrite() So working copy update can pass it in.
mercurial/localrepo.py
--- a/mercurial/localrepo.py	Sat Feb 20 15:24:12 2016 -0800
+++ b/mercurial/localrepo.py	Sat Feb 20 15:25:27 2016 -0800
@@ -974,7 +974,7 @@
             data = self.wvfs.read(filename)
         return self._filter(self._encodefilterpats, filename, data)
 
-    def wwrite(self, filename, data, flags):
+    def wwrite(self, filename, data, flags, backgroundclose=False):
         """write ``data`` into ``filename`` in the working directory
 
         This returns length of written (maybe decoded) data.
@@ -983,7 +983,7 @@
         if 'l' in flags:
             self.wvfs.symlink(data, filename)
         else:
-            self.wvfs.write(filename, data)
+            self.wvfs.write(filename, data, backgroundclose=backgroundclose)
             if 'x' in flags:
                 self.wvfs.setflags(filename, False, True)
         return len(data)