##// END OF EJS Templates
cmdutil: extract function checking if pattern should be taken as stdin/out...
Yuya Nishihara -
r32539:447bbd97 default
parent child Browse files
Show More
@@ -610,6 +610,10 b' def makefilename(repo, pat, node, desc=N'
610 raise error.Abort(_("invalid format spec '%%%s' in output filename") %
610 raise error.Abort(_("invalid format spec '%%%s' in output filename") %
611 inst.args[0])
611 inst.args[0])
612
612
613 def isstdiofilename(pat):
614 """True if the given pat looks like a filename denoting stdin/stdout"""
615 return not pat or pat == '-'
616
613 class _unclosablefile(object):
617 class _unclosablefile(object):
614 def __init__(self, fp):
618 def __init__(self, fp):
615 self._fp = fp
619 self._fp = fp
@@ -635,7 +639,7 b' def makefileobj(repo, pat, node=None, de'
635
639
636 writable = mode not in ('r', 'rb')
640 writable = mode not in ('r', 'rb')
637
641
638 if not pat or pat == '-':
642 if isstdiofilename(pat):
639 if writable:
643 if writable:
640 fp = repo.ui.fout
644 fp = repo.ui.fout
641 else:
645 else:
General Comments 0
You need to be logged in to leave comments. Login now