scmutil: support background closing for write()
authorGregory Szorc <gregory.szorc@gmail.com>
Sat, 20 Feb 2016 15:24:12 -0800
changeset 28197 2ada62388bb1
parent 28196 87de4a22e8c2
child 28198 ddc07ddcca94
scmutil: support background closing for write() Upcoming patches will add background file closer support to working copy update. This patch adds some plumbing to prepare for that.
mercurial/scmutil.py
--- a/mercurial/scmutil.py	Tue Feb 16 11:08:52 2016 +0000
+++ b/mercurial/scmutil.py	Sat Feb 20 15:24:12 2016 -0800
@@ -276,8 +276,8 @@
         with self(path, mode=mode) as fp:
             return fp.readlines()
 
-    def write(self, path, data):
-        with self(path, 'wb') as fp:
+    def write(self, path, data, backgroundclose=False):
+        with self(path, 'wb', backgroundclose=backgroundclose) as fp:
             return fp.write(data)
 
     def writelines(self, path, data, mode='wb', notindexed=False):