cmdutil: fix mode handling in make_file
authorAdrian Buehlmann <adrian@cadifra.com>
Wed, 23 Feb 2011 23:30:48 +0100
changeset 13769 8796fb6af67e
parent 13768 10aea25fb519
child 13770 4e8f2310f310
cmdutil: fix mode handling in make_file
mercurial/cmdutil.py
--- a/mercurial/cmdutil.py	Sat Mar 26 17:12:02 2011 -0500
+++ b/mercurial/cmdutil.py	Wed Feb 23 23:30:48 2011 +0100
@@ -230,7 +230,7 @@
 def make_file(repo, pat, node=None,
               total=None, seqno=None, revwidth=None, mode='wb', pathname=None):
 
-    writable = 'w' in mode or 'a' in mode
+    writable = mode not in ('r', 'rb')
 
     if not pat or pat == '-':
         fp = writable and sys.stdout or sys.stdin