--- a/mercurial/commands.py Mon Jul 26 22:29:49 2010 +0200
+++ b/mercurial/commands.py Mon Jul 26 23:26:15 2010 +0200
@@ -890,7 +890,7 @@
# we don't want to fail in merges during buildup
os.environ['HGMERGE'] = 'internal:local'
- def writefile(fname, text, fmode="w"):
+ def writefile(fname, text, fmode="wb"):
f = open(fname, fmode)
try:
f.write(text)
@@ -925,7 +925,7 @@
merge(ui, repo, node=p2)
if mergeable_file:
- f = open("mf", "r+")
+ f = open("mf", "rb+")
try:
lines = f.read().split("\n")
lines[id * linesperrev] += " r%i" % id
@@ -935,7 +935,7 @@
f.close()
if appended_file:
- writefile("af", "r%i\n" % id, "a")
+ writefile("af", "r%i\n" % id, "ab")
if overwritten_file:
writefile("of", "r%i\n" % id)