Show More
@@ -48,8 +48,6 b' def extract(ui, fileobj):' | |||||
48 | fd, tmpname = tempfile.mkstemp(prefix='hg-patch-') |
|
48 | fd, tmpname = tempfile.mkstemp(prefix='hg-patch-') | |
49 | tmpfp = os.fdopen(fd, 'w') |
|
49 | tmpfp = os.fdopen(fd, 'w') | |
50 | try: |
|
50 | try: | |
51 | hgpatch = False |
|
|||
52 |
|
||||
53 | msg = email.Parser.Parser().parse(fileobj) |
|
51 | msg = email.Parser.Parser().parse(fileobj) | |
54 |
|
52 | |||
55 | message = msg['Subject'] |
|
53 | message = msg['Subject'] | |
@@ -77,6 +75,9 b' def extract(ui, fileobj):' | |||||
77 | payload = part.get_payload(decode=True) |
|
75 | payload = part.get_payload(decode=True) | |
78 | m = diffre.search(payload) |
|
76 | m = diffre.search(payload) | |
79 | if m: |
|
77 | if m: | |
|
78 | hgpatch = False | |||
|
79 | ignoretext = False | |||
|
80 | ||||
80 | ui.debug(_('found patch at byte %d\n') % m.start(0)) |
|
81 | ui.debug(_('found patch at byte %d\n') % m.start(0)) | |
81 | diffs_seen += 1 |
|
82 | diffs_seen += 1 | |
82 | cfp = cStringIO.StringIO() |
|
83 | cfp = cStringIO.StringIO() | |
@@ -96,7 +97,9 b' def extract(ui, fileobj):' | |||||
96 | ui.debug('From: %s\n' % user) |
|
97 | ui.debug('From: %s\n' % user) | |
97 | elif line.startswith("# Date "): |
|
98 | elif line.startswith("# Date "): | |
98 | date = line[7:] |
|
99 | date = line[7:] | |
99 | if not line.startswith('# '): |
|
100 | elif line == '---' and 'git-send-email' in msg['X-Mailer']: | |
|
101 | ignoretext = True | |||
|
102 | if not line.startswith('# ') and not ignoretext: | |||
100 | cfp.write(line) |
|
103 | cfp.write(line) | |
101 | cfp.write('\n') |
|
104 | cfp.write('\n') | |
102 | message = cfp.getvalue() |
|
105 | message = cfp.getvalue() |
General Comments 0
You need to be logged in to leave comments.
Login now