diff mercurial/hg.py @ 417:f2d1f5fd0179

[PATCH] file type fixes for the other 'OS' -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 [PATCH] file type fixes for the other 'OS' From: K Thananchayan <thananck@yahoo.com> Filetype fixes: All working files and files in the repository are processed as binary. .hgignore is read as text when constructing ignorelist as this file is intended to be edited. manifest hash: c034cdcc54011fd3de9e32f1aa8b2b6f84e1b2b8 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQFCuNoRywK+sNU5EO8RAjarAJ9ScUoFL1A7mpO7qorCy6okhi0nggCcDgpp dfDl4dALGQA0PqXqtI+T5gU= =IVxr -----END PGP SIGNATURE-----
author mpm@selenic.com
date Tue, 21 Jun 2005 19:25:05 -0800
parents 5e9e8b8d2629
children 0446f698d38e
line wrap: on
line diff
--- a/mercurial/hg.py	Tue Jun 21 19:19:39 2005 -0800
+++ b/mercurial/hg.py	Tue Jun 21 19:25:05 2005 -0800
@@ -336,7 +336,7 @@
                     os.makedirs(d)
             else:
                 if s.st_nlink > 1:
-                    file(f + ".tmp", "w").write(file(f).read())
+                    file(f + ".tmp", "wb").write(file(f, "rb").read())
                     os.rename(f+".tmp", f)
 
         return file(f, mode)
@@ -386,7 +386,7 @@
         if self.ignorelist is None:
             self.ignorelist = []
             try:
-                l = self.wfile(".hgignore")
+                l = file(self.wjoin(".hgignore"))
                 for pat in l:
                     if pat != "\n":
                         self.ignorelist.append(re.compile(pat[:-1]))
@@ -569,7 +569,7 @@
             try:
                 fp = self.wjoin(f)
                 mf1[f] = is_exec(fp)
-                t = file(fp).read()
+                t = self.wopener(f).read()
             except IOError:
                 self.warn("trouble committing %s!\n" % f)
                 raise
@@ -1198,7 +1198,7 @@
         def temp(prefix, node):
             pre = "%s~%s." % (os.path.basename(fn), prefix)
             (fd, name) = tempfile.mkstemp("", pre)
-            f = os.fdopen(fd, "w")
+            f = os.fdopen(fd, "wb")
             f.write(fl.revision(node))
             f.close()
             return name