Mercurial > public > mercurial-scm > hg-stable
diff mercurial/util.py @ 14167:0e4753807c93
util & scmutil: adapt read/write helpers as request by mpm
author | Dan Villiom Podlaski Christiansen <danchr@gmail.com> |
---|---|
date | Mon, 02 May 2011 10:11:05 +0200 |
parents | 617483af1cc0 |
children | 116de1da2154 |
line wrap: on
line diff
--- a/mercurial/util.py Mon May 02 09:11:35 2011 +0200 +++ b/mercurial/util.py Mon May 02 10:11:05 2011 +0200 @@ -778,8 +778,15 @@ finally: fp.close() -def writefile(path, mode, text): - fp = open(path, mode) +def writefile(path, text): + fp = open(path, 'wb') + try: + fp.write(text) + finally: + fp.close() + +def appendfile(path, text): + fp = open(path, 'ab') try: fp.write(text) finally: