--- a/mercurial/patch.py Fri Sep 10 10:28:18 2010 +0200
+++ b/mercurial/patch.py Thu Oct 14 01:28:29 2010 +0200
@@ -228,8 +228,9 @@
diffs_seen += 1
cfp = cStringIO.StringIO()
for line in payload[:m.start(0)].splitlines():
- if line.startswith('# HG changeset patch'):
+ if line.startswith('# HG changeset patch') and not hgpatch:
ui.debug('patch generated by hg export\n')
+ hgpatch = True
hgpatchheader = True
# drop earlier commit message content
cfp.seek(0)
@@ -249,7 +250,6 @@
parents.append(line[10:])
elif not line.startswith("# "):
hgpatchheader = False
- hgpatch = True
elif line == '---' and gitsendmail:
ignoretext = True
if not hgpatchheader and not ignoretext: