comparison mercurial/cmdutil.py @ 32538:2dd8d4108249

cmdutil: drop deprecated hack to pass file object to makefileobj() (API) All callers pass a string 'pat' or None.
author Yuya Nishihara <yuya@tcha.org>
date Thu, 25 May 2017 21:25:49 +0900
parents 9f56d462634c
children 447bbd970047
comparison
equal deleted inserted replaced
32537:044f3d7eb9ae 32538:2dd8d4108249
639 if writable: 639 if writable:
640 fp = repo.ui.fout 640 fp = repo.ui.fout
641 else: 641 else:
642 fp = repo.ui.fin 642 fp = repo.ui.fin
643 return _unclosablefile(fp) 643 return _unclosablefile(fp)
644 if util.safehasattr(pat, 'write') and writable:
645 return pat
646 if util.safehasattr(pat, 'read') and 'r' in mode:
647 return pat
648 fn = makefilename(repo, pat, node, desc, total, seqno, revwidth, pathname) 644 fn = makefilename(repo, pat, node, desc, total, seqno, revwidth, pathname)
649 if modemap is not None: 645 if modemap is not None:
650 mode = modemap.get(fn, mode) 646 mode = modemap.get(fn, mode)
651 if mode == 'wb': 647 if mode == 'wb':
652 modemap[fn] = 'ab' 648 modemap[fn] = 'ab'