mercurial/commands.py
changeset 738 32a97c9d8e98
parent 737 8db4d406b3d3
child 739 36edb39e8e8c
--- a/mercurial/commands.py	Wed Jul 20 03:52:06 2005 -0800
+++ b/mercurial/commands.py	Wed Jul 20 03:55:16 2005 -0800
@@ -121,6 +121,10 @@
     if not pat or pat == '-':
         if 'w' in mode: return sys.stdout
         else: return sys.stdin
+    if hasattr(pat, 'write') and 'w' in mode:
+        return pat
+    if hasattr(pat, 'read') and 'r' in mode:
+        return pat
     node_expander = {
         'H': lambda: hg.hex(node),
         'R': lambda: str(r.rev(node)),