Commit 33c575d1 authored by Ben Hutchings's avatar Ben Hutchings

pq import: Always put DEP-3 headers as pseudo-headers

If there are any non-git DEP-3 header fields, put them at the top of
the body text, regardless of whether Description or Subject is used.
Also put a blank line between them and the rest of the message body.
parent ba4d6666
......@@ -218,6 +218,7 @@ class Dep3Patch(Patch):
return 1
changes = 0
pseudo_headers = ''
long_desc = self._dep3_get_value(headers.get('long_desc', list()))
for k, v in headers.items():
......@@ -230,10 +231,12 @@ class Dep3Patch(Patch):
elif k == 'long_desc':
long_desc += ''.join(v)
pseudo_headers += ''.join(v)
changes += 1
if changes:
self.long_desc = long_desc + self.long_desc
self.long_desc = (pseudo_headers +
('\n' if pseudo_headers else '') +
long_desc + self.long_desc)
def _check_dep3(self):
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment