equal
deleted
inserted
replaced
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 |