diff mercurial/commands.py @ 11686:fc360de66217

debugbuilddag: build repository content in binary mode
author Patrick Mezard <pmezard@gmail.com>
date Mon, 26 Jul 2010 23:26:15 +0200
parents c4f6f0a1bd5a
children efcdf6a953a0
line wrap: on
line diff
--- 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)