changeset 1329:8f06817bf266

Allow files to be opened in text mode, even on Windows.
author Bryan O'Sullivan <bos@serpentine.com>
date Fri, 23 Sep 2005 10:28:55 -0700
parents 04ed65045bcc
children 0fcde73dc3ca
files mercurial/util.py
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/util.py	Fri Sep 23 07:41:25 2005 -0700
+++ b/mercurial/util.py	Fri Sep 23 10:28:55 2005 -0700
@@ -327,10 +327,11 @@
     remote file access from higher level code.
     """
     p = base
-    def o(path, mode="r"):
+    def o(path, mode="r", text=False):
         f = os.path.join(p, path)
 
-        mode += "b" # for that other OS
+        if not text:
+            mode += "b" # for that other OS
 
         if mode[0] != "r":
             try:
@@ -549,7 +550,7 @@
     if time.daylight: tz = time.altzone
     else: tz = time.timezone
     return t, tz
-    
+
 def datestr(date=None, format='%c'):
     """represent a (unixtime, offset) tuple as a localized time.
     unixtime is seconds since the epoch, and offset is the time zone's