Let patch.export handle any fp-like object

This commit is contained in:
Brendan Cully 2007-03-01 20:53:38 -08:00
parent 05d497adec
commit 507ce565c1

View File

@ -610,7 +610,7 @@ def export(repo, revs, template='hg-%h.patch', fp=None, switch_parent=False,
if not fp:
fp = cmdutil.make_file(repo, template, node, total=total,
seqno=seqno, revwidth=revwidth)
if fp not in (sys.stdout, repo.ui):
if hasattr(fp, 'name'):
repo.ui.note("%s\n" % fp.name)
fp.write("# HG changeset patch\n")