changeset 13769:8796fb6af67e

cmdutil: fix mode handling in make_file
author Adrian Buehlmann <adrian@cadifra.com>
date Wed, 23 Feb 2011 23:30:48 +0100
parents 10aea25fb519
children 4e8f2310f310
files mercurial/cmdutil.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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