# HG changeset patch # User Waqas Hussain # Date 2011-02-23 08:21:55 # Node ID 31aa2e5b07501ddcfd781e6a833db018fef46210 # Parent f2295f7cd468f56e4ae43a3dad50c59fe4f42dfe export: only close files which export itself has opened diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -681,9 +681,10 @@ def export(repo, revs, template='hg-%h.p shouldclose = False if not fp: - shouldclose = True fp = make_file(repo, template, node, total=total, seqno=seqno, revwidth=revwidth, mode='ab') + if fp != template: + shouldclose = True if fp != sys.stdout and hasattr(fp, 'name'): repo.ui.note("%s\n" % fp.name)