comparison 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
comparison
equal deleted inserted replaced
14166:9cbff8a39a2a 14167:0e4753807c93
776 try: 776 try:
777 return fp.read() 777 return fp.read()
778 finally: 778 finally:
779 fp.close() 779 fp.close()
780 780
781 def writefile(path, mode, text): 781 def writefile(path, text):
782 fp = open(path, mode) 782 fp = open(path, 'wb')
783 try:
784 fp.write(text)
785 finally:
786 fp.close()
787
788 def appendfile(path, text):
789 fp = open(path, 'ab')
783 try: 790 try:
784 fp.write(text) 791 fp.write(text)
785 finally: 792 finally:
786 fp.close() 793 fp.close()
787 794