[PATCH 07 of 10] vfs: add "writelines"
FUJIWARA Katsunori
foozy at lares.dti.ne.jp
Wed May 28 15:00:19 UTC 2014
# HG changeset patch
# User FUJIWARA Katsunori <foozy at lares.dti.ne.jp>
# Date 1401288802 -32400
# Wed May 28 23:53:22 2014 +0900
# Node ID 7c8b2bdd6f3e6cbaa44ac59652e246fa506b95b0
# Parent e8bcf7420213eb28e5f1217fbed7fd1c69200fc5
vfs: add "writelines"
diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -170,6 +170,13 @@ class abstractvfs(object):
finally:
fp.close()
+ def writelines(self, path, data, mode='wb', notindexed=False):
+ fp = self(path, mode=mode, notindexed=notindexed)
+ try:
+ return fp.writelines(data)
+ finally:
+ fp.close()
+
def append(self, path, data):
fp = self(path, 'ab')
try:
More information about the Mercurial-devel
mailing list