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)