Patchwork [1,of,4] cmdutil: drop deprecated hack to pass file object to makefileobj() (API)

login
register
mail settings
Submitter Yuya Nishihara
Date May 29, 2017, 2:30 p.m.
Message ID <f5488f76ec965a9d84d8.1496068248@mimosa>
Download mbox | patch
Permalink /patch/21042/
State Accepted
Headers show

Comments

Yuya Nishihara - May 29, 2017, 2:30 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1495715149 -32400
#      Thu May 25 21:25:49 2017 +0900
# Node ID f5488f76ec965a9d84d8101fc856c221c63e7ad9
# Parent  f54d0838ba7a86c9572cc00dab70a45adc49fa24
cmdutil: drop deprecated hack to pass file object to makefileobj() (API)

All callers pass a string 'pat' or None.

Patch

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -641,10 +641,6 @@  def makefileobj(repo, pat, node=None, de
         else:
             fp = repo.ui.fin
         return _unclosablefile(fp)
-    if util.safehasattr(pat, 'write') and writable:
-        return pat
-    if util.safehasattr(pat, 'read') and 'r' in mode:
-        return pat
     fn = makefilename(repo, pat, node, desc, total, seqno, revwidth, pathname)
     if modemap is not None:
         mode = modemap.get(fn, mode)