# HG changeset patch # User FUJIWARA Katsunori # Date 2014-11-19 09:35:14 # Node ID 1df6519eb3abe34990073935534553b181d7f06c # Parent 46265d0f0c7ba1c492985a42ef60313193d1eb17 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: