# HG changeset patch # User Yuya Nishihara # Date 2015-12-13 10:57:54 # Node ID 9073a1e457c9054c9dc0e47ab079962a56481331 # Parent 9d04b4da6773ee0b9b354fec29ca0a938d7dcf18 export: remove useless comparison between file object and string It was introduced at 31aa2e5b0750, where "template" argument could be a file object. After that, a306837f8c87 added "len(template)", so "template" must be a string now. Therefore, "fp != template" should always be True. It seems 31aa2e5b0750 was intended to work around a bug in TortoiseHg, and I'm sure I've fixed it completely in TortoiseHg source. https://selenic.com/pipermail/mercurial-devel/2011-February/028467.html diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -1054,8 +1054,7 @@ def export(repo, revs, template='hg-%h.p fp = makefileobj(repo, template, node, desc=desc, total=total, seqno=seqno, revwidth=revwidth, mode='wb', modemap=filemode) - if fp != template: - shouldclose = True + shouldclose = True if fp and not getattr(fp, 'name', '').startswith('<'): repo.ui.note("%s\n" % fp.name)