--- a/mercurial/commands.py Tue Jun 27 10:49:46 2006 -0400
+++ b/mercurial/commands.py Tue Jun 27 09:30:50 2006 -0700
@@ -1787,10 +1787,16 @@
diffs_seen += 1
hgpatch = False
fp = cStringIO.StringIO()
+ if message:
+ fp.write(message)
+ fp.write('\n')
for line in payload[:m.start(0)].splitlines():
if line.startswith('# HG changeset patch'):
ui.debug(_('patch generated by hg export\n'))
hgpatch = True
+ # drop earlier commit message content
+ fp.seek(0)
+ fp.truncate()
elif hgpatch:
if line.startswith('# User '):
user = line[7:]
@@ -1800,8 +1806,7 @@
if not line.startswith('# '):
fp.write(line)
fp.write('\n')
- hgpatch = False
- message = fp.getvalue() or message
+ message = fp.getvalue()
if tmpfp:
tmpfp.write(payload)
if not payload.endswith('\n'):