diff -r f2295f7cd468 -r 31aa2e5b0750 mercurial/cmdutil.py --- a/mercurial/cmdutil.py Wed Feb 23 10:59:36 2011 -0500 +++ b/mercurial/cmdutil.py Wed Feb 23 13:21:55 2011 +0500 @@ -681,9 +681,10 @@ 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)