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.
--- 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):