[PATCH 09 of 11] vfs: add "writelines"
FUJIWARA Katsunori
foozy at lares.dti.ne.jp
Wed Nov 19 09:41:54 UTC 2014
# HG changeset patch
# User FUJIWARA Katsunori <foozy at lares.dti.ne.jp>
# Date 1416389714 -32400
# Wed Nov 19 18:35:14 2014 +0900
# Node ID 06bcf5cdf1e38238fa022dd3e35b56f8ba13af5b
# Parent fdebbb2775b7d9b4a94f5865f192c4a2da76e9f6
vfs: add "writelines"
This patch allows "writelines" to take "mode" and "notindexed"
arguments, because subsequent patch for subrepo requires both.
diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -229,6 +229,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