Show More
@@ -182,8 +182,8 b' def extract(ui, fileobj):' | |||||
182 | msg = email.Parser.Parser().parse(fileobj) |
|
182 | msg = email.Parser.Parser().parse(fileobj) | |
183 |
|
183 | |||
184 | subject = msg['Subject'] |
|
184 | subject = msg['Subject'] | |
185 | user = msg['From'] |
|
185 | data['user'] = msg['From'] | |
186 | if not subject and not user: |
|
186 | if not subject and not data['user']: | |
187 | # Not an email, restore parsed headers if any |
|
187 | # Not an email, restore parsed headers if any | |
188 | subject = '\n'.join(': '.join(h) for h in msg.items()) + '\n' |
|
188 | subject = '\n'.join(': '.join(h) for h in msg.items()) + '\n' | |
189 |
|
189 | |||
@@ -197,8 +197,8 b' def extract(ui, fileobj):' | |||||
197 | subject = subject[pend + 1:].lstrip() |
|
197 | subject = subject[pend + 1:].lstrip() | |
198 | subject = re.sub(r'\n[ \t]+', ' ', subject) |
|
198 | subject = re.sub(r'\n[ \t]+', ' ', subject) | |
199 | ui.debug('Subject: %s\n' % subject) |
|
199 | ui.debug('Subject: %s\n' % subject) | |
200 | if user: |
|
200 | if data['user']: | |
201 | ui.debug('From: %s\n' % user) |
|
201 | ui.debug('From: %s\n' % data['user']) | |
202 | diffs_seen = 0 |
|
202 | diffs_seen = 0 | |
203 | ok_types = ('text/plain', 'text/x-diff', 'text/x-patch') |
|
203 | ok_types = ('text/plain', 'text/x-diff', 'text/x-patch') | |
204 | message = '' |
|
204 | message = '' | |
@@ -228,8 +228,8 b' def extract(ui, fileobj):' | |||||
228 | subject = None |
|
228 | subject = None | |
229 | elif hgpatchheader: |
|
229 | elif hgpatchheader: | |
230 | if line.startswith('# User '): |
|
230 | if line.startswith('# User '): | |
231 | user = line[7:] |
|
231 | data['user'] = line[7:] | |
232 | ui.debug('From: %s\n' % user) |
|
232 | ui.debug('From: %s\n' % data['user']) | |
233 | elif line.startswith("# Date "): |
|
233 | elif line.startswith("# Date "): | |
234 | data['date'] = line[7:] |
|
234 | data['date'] = line[7:] | |
235 | elif line.startswith("# Branch "): |
|
235 | elif line.startswith("# Branch "): | |
@@ -260,7 +260,6 b' def extract(ui, fileobj):' | |||||
260 | if subject and not message.startswith(subject): |
|
260 | if subject and not message.startswith(subject): | |
261 | message = '%s\n%s' % (subject, message) |
|
261 | message = '%s\n%s' % (subject, message) | |
262 | data['message'] = message |
|
262 | data['message'] = message | |
263 | data['user'] = user |
|
|||
264 | tmpfp.close() |
|
263 | tmpfp.close() | |
265 | if parents: |
|
264 | if parents: | |
266 | data['p1'] = parents.pop(0) |
|
265 | data['p1'] = parents.pop(0) |
General Comments 0
You need to be logged in to leave comments.
Login now