Show More
@@ -50,7 +50,7 b' def extract(ui, fileobj):' | |||
|
50 | 50 | try: |
|
51 | 51 | msg = email.Parser.Parser().parse(fileobj) |
|
52 | 52 | |
|
53 |
|
|
|
53 | subject = msg['Subject'] | |
|
54 | 54 | user = msg['From'] |
|
55 | 55 | # should try to parse msg['Date'] |
|
56 | 56 | date = None |
@@ -58,13 +58,13 b' def extract(ui, fileobj):' | |||
|
58 | 58 | branch = None |
|
59 | 59 | parents = [] |
|
60 | 60 | |
|
61 |
if |
|
|
62 |
if |
|
|
63 |
pend = |
|
|
61 | if subject: | |
|
62 | if subject.startswith('[PATCH'): | |
|
63 | pend = subject.find(']') | |
|
64 | 64 | if pend >= 0: |
|
65 |
|
|
|
66 |
|
|
|
67 |
ui.debug('Subject: %s\n' % |
|
|
65 | subject = subject[pend+1:].lstrip() | |
|
66 | subject = subject.replace('\n\t', ' ') | |
|
67 | ui.debug('Subject: %s\n' % subject) | |
|
68 | 68 | if user: |
|
69 | 69 | ui.debug('From: %s\n' % user) |
|
70 | 70 | diffs_seen = 0 |
@@ -84,9 +84,6 b' def extract(ui, fileobj):' | |||
|
84 | 84 | ui.debug(_('found patch at byte %d\n') % m.start(0)) |
|
85 | 85 | diffs_seen += 1 |
|
86 | 86 | cfp = cStringIO.StringIO() |
|
87 | if message: | |
|
88 | cfp.write(message) | |
|
89 | cfp.write('\n') | |
|
90 | 87 | for line in payload[:m.start(0)].splitlines(): |
|
91 | 88 | if line.startswith('# HG changeset patch'): |
|
92 | 89 | ui.debug(_('patch generated by hg export\n')) |
@@ -123,6 +120,8 b' def extract(ui, fileobj):' | |||
|
123 | 120 | os.unlink(tmpname) |
|
124 | 121 | raise |
|
125 | 122 | |
|
123 | if subject and not message.startswith(subject): | |
|
124 | message = '%s\n%s' % (subject, message) | |
|
126 | 125 | tmpfp.close() |
|
127 | 126 | if not diffs_seen: |
|
128 | 127 | os.unlink(tmpname) |
General Comments 0
You need to be logged in to leave comments.
Login now