Mercurial > hg-stable
changeset 23371:1df6519eb3ab
vfs: add "writelines"
This patch allows "writelines" to take "mode" and "notindexed"
arguments, because subsequent patch for subrepo requires both.
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Wed, 19 Nov 2014 18:35:14 +0900 |
parents | 46265d0f0c7b |
children | 6cfa7a73b6e7 |
files | mercurial/scmutil.py |
diffstat | 1 files changed, 7 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/scmutil.py Wed Nov 19 18:35:14 2014 +0900 +++ b/mercurial/scmutil.py Wed Nov 19 18:35:14 2014 +0900 @@ -229,6 +229,13 @@ 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: