mercurial/cmdutil.py
changeset 14637 5e9d691229d5
parent 14635 217b7d83afc3
child 14638 1bdbca0b6604
equal deleted inserted replaced
14636:b98063487a6f 14637:5e9d691229d5
   158                 seqno=None, revwidth=None, mode='wb', pathname=None):
   158                 seqno=None, revwidth=None, mode='wb', pathname=None):
   159 
   159 
   160     writable = mode not in ('r', 'rb')
   160     writable = mode not in ('r', 'rb')
   161 
   161 
   162     if not pat or pat == '-':
   162     if not pat or pat == '-':
   163         fp = writable and sys.stdout or sys.stdin
   163         fp = writable and repo.ui.fout or repo.ui.fin
   164         return os.fdopen(os.dup(fp.fileno()), mode)
   164         return os.fdopen(os.dup(fp.fileno()), mode)
   165     if hasattr(pat, 'write') and writable:
   165     if hasattr(pat, 'write') and writable:
   166         return pat
   166         return pat
   167     if hasattr(pat, 'read') and 'r' in mode:
   167     if hasattr(pat, 'read') and 'r' in mode:
   168         return pat
   168         return pat