equal
deleted
inserted
replaced
231 total=None, seqno=None, revwidth=None, mode='wb', pathname=None): |
231 total=None, seqno=None, revwidth=None, mode='wb', pathname=None): |
232 |
232 |
233 writable = 'w' in mode or 'a' in mode |
233 writable = 'w' in mode or 'a' in mode |
234 |
234 |
235 if not pat or pat == '-': |
235 if not pat or pat == '-': |
236 return writable and sys.stdout or sys.stdin |
236 fp = writable and sys.stdout or sys.stdin |
|
237 return os.fdopen(os.dup(fp.fileno()), mode) |
237 if hasattr(pat, 'write') and writable: |
238 if hasattr(pat, 'write') and writable: |
238 return pat |
239 return pat |
239 if hasattr(pat, 'read') and 'r' in mode: |
240 if hasattr(pat, 'read') and 'r' in mode: |
240 return pat |
241 return pat |
241 return open(make_filename(repo, pat, node, total, seqno, revwidth, |
242 return open(make_filename(repo, pat, node, total, seqno, revwidth, |