##// END OF EJS Templates
import: only the first hg patch marker should be processed (issue2417)...
Mads Kiilerich -
r12728:80a3d112 default
parent child Browse files
Show More
@@ -228,8 +228,9 b' def extract(ui, fileobj):'
228 diffs_seen += 1
228 diffs_seen += 1
229 cfp = cStringIO.StringIO()
229 cfp = cStringIO.StringIO()
230 for line in payload[:m.start(0)].splitlines():
230 for line in payload[:m.start(0)].splitlines():
231 if line.startswith('# HG changeset patch'):
231 if line.startswith('# HG changeset patch') and not hgpatch:
232 ui.debug('patch generated by hg export\n')
232 ui.debug('patch generated by hg export\n')
233 hgpatch = True
233 hgpatchheader = True
234 hgpatchheader = True
234 # drop earlier commit message content
235 # drop earlier commit message content
235 cfp.seek(0)
236 cfp.seek(0)
@@ -249,7 +250,6 b' def extract(ui, fileobj):'
249 parents.append(line[10:])
250 parents.append(line[10:])
250 elif not line.startswith("# "):
251 elif not line.startswith("# "):
251 hgpatchheader = False
252 hgpatchheader = False
252 hgpatch = True
253 elif line == '---' and gitsendmail:
253 elif line == '---' and gitsendmail:
254 ignoretext = True
254 ignoretext = True
255 if not hgpatchheader and not ignoretext:
255 if not hgpatchheader and not ignoretext:
@@ -51,8 +51,11 b' Prepare source repo and patch:'
51 $ hg ci -A -m 0 a -d '0 0'
51 $ hg ci -A -m 0 a -d '0 0'
52 $ echo 1 >> a
52 $ echo 1 >> a
53 $ cat << eof > log
53 $ cat << eof > log
54 > 1
54 > first line which can't start with '# '
55 > # comment for 1
55 > # second line is a comment but that shouldn't be a problem.
56 > A patch marker like this was more problematic even after d7452292f9d3:
57 > # HG changeset patch
58 > # User lines looks like this - but it _is_ just a comment
56 > eof
59 > eof
57 $ hg ci -l log -d '0 0'
60 $ hg ci -l log -d '0 0'
58 $ hg export -o p 1
61 $ hg export -o p 1
@@ -72,14 +75,17 b' Clone and apply patch:'
72 $ hg import ../c/p
75 $ hg import ../c/p
73 applying ../c/p
76 applying ../c/p
74 $ hg log -v -r 1
77 $ hg log -v -r 1
75 changeset: 1:89bf2f6d8088
78 changeset: 1:e8cc66fbbaa6
76 tag: tip
79 tag: tip
77 user: test
80 user: test
78 date: Thu Jan 01 00:00:00 1970 +0000
81 date: Thu Jan 01 00:00:00 1970 +0000
79 files: a
82 files: a
80 description:
83 description:
81 1
84 first line which can't start with '# '
82 # comment for 1
85 # second line is a comment but that shouldn't be a problem.
86 A patch marker like this was more problematic even after d7452292f9d3:
87 # HG changeset patch
88 # User lines looks like this - but it _is_ just a comment
83
89
84
90
85 $ cd ..
91 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now