Mercurial > public > mercurial-scm > hg
comparison mercurial/scmutil.py @ 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 | 3778884197f0 |
comparison
equal
deleted
inserted
replaced
23370:46265d0f0c7b | 23371:1df6519eb3ab |
---|---|
224 | 224 |
225 def write(self, path, data): | 225 def write(self, path, data): |
226 fp = self(path, 'wb') | 226 fp = self(path, 'wb') |
227 try: | 227 try: |
228 return fp.write(data) | 228 return fp.write(data) |
229 finally: | |
230 fp.close() | |
231 | |
232 def writelines(self, path, data, mode='wb', notindexed=False): | |
233 fp = self(path, mode=mode, notindexed=notindexed) | |
234 try: | |
235 return fp.writelines(data) | |
229 finally: | 236 finally: |
230 fp.close() | 237 fp.close() |
231 | 238 |
232 def append(self, path, data): | 239 def append(self, path, data): |
233 fp = self(path, 'ab') | 240 fp = self(path, 'ab') |