extdiff: open files in binary mode
Problem noticed by Darrell Gallion.
--- a/hgext/extdiff.py Thu Feb 15 12:51:43 2007 +0300
+++ b/hgext/extdiff.py Thu Feb 15 08:14:03 2007 -0200
@@ -77,7 +77,7 @@
destdir = os.path.dirname(dest)
if not os.path.isdir(destdir):
os.makedirs(destdir)
- repo.wwrite(wfn, repo.file(fn).read(mf[fn]), open(dest, 'w'))
+ repo.wwrite(wfn, repo.file(fn).read(mf[fn]), open(dest, 'wb'))
return dirname
def snapshot_wdir(files):
@@ -99,7 +99,7 @@
destdir = os.path.dirname(dest)
if not os.path.isdir(destdir):
os.makedirs(destdir)
- fp = open(dest, 'w')
+ fp = open(dest, 'wb')
for chunk in util.filechunkiter(repo.wopener(wfn)):
fp.write(chunk)
return dirname