Commit 67a63377 authored by Arkadiusz Hiler's avatar Arkadiusz Hiler

parsemail: Fix cover letter handling

If cover letter looked like a patch (i.e. had the diff markers) it was
parsed as such, resulting in the diff being extracted out from the
contents and stored as oddly numbered patch 0.

Let's store the raw payload and do not create patches out of cover
letters.

This is now tested by adding some diff excerpt to one of the test
fixtures and adjusting the asserts on cover_letter and raw_cover_letter
accordingly.
Signed-off-by: Arkadiusz Hiler's avatarArkadiusz Hiler <arkadiusz.hiler@intel.com>
parent c9fcb1d2
......@@ -406,7 +406,7 @@ def find_content(project, mail, force_comment=False):
drop_patch = not is_attachment and \
project.git_send_email_only and not is_git_send_email(mail)
if pullurl or (is_patch and not drop_patch):
if pullurl or (is_patch and not drop_patch and not is_cover_letter):
ret.patch_order = x or 1
ret.patch = Patch(name=name, pull_url=pullurl, content=patchbuf,
date=mail_date(mail), headers=mail_headers(mail))
......@@ -436,7 +436,7 @@ def find_content(project, mail, force_comment=False):
if is_cover_letter:
ret.revision.raw_cover_letter_headers = mail_headers(mail)
ret.revision.raw_cover_letter = commentbuf
ret.revision.raw_cover_letter = payload
ret.revision.cover_letter = clean_content(commentbuf)
return ret
......
......@@ -34,6 +34,22 @@ a series introducing macros to iterate through the CRTCs instead of using
list_for_each_entry() and mode_config.crtc_list, a tiny bit more readable and
easier to recall.
Some random diff:
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 8885455..edf7299 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -163,6 +163,9 @@ enum hpd_pin {
#define for_each_pipe(p) for ((p) = 0; (p) < INTEL_INFO(dev)->num_pipes; (p)++)
#define for_each_sprite(p, s) for ((s) = 0; (s) < INTEL_INFO(dev)->num_sprites[(p)]; (s)++)
+#define for_each_intel_crtc(dev, intel_crtc) \
+ list_for_each_entry(intel_crtc, &dev->mode_config.crtc_list, base.head)
+
#define for_each_encoder_on_crtc(dev, __crtc, intel_encoder) \
list_for_each_entry((intel_encoder), &(dev)->mode_config.encoder_list, base.head) \
if ((intel_encoder)->base.crtc == (__crtc))
Damien Lespiau (4):
drm/i915: Introduce a for_each_intel_crtc() macro
drm/i915: Use for_each_intel_crtc() when iterating through intel_crtcs
......
......@@ -256,7 +256,7 @@ class APITest(APITestBase):
self.check_mbox("/series/%s/revisions/1/mbox_with_cover/" %
self.series.pk,
'for_each_-intel_-crtc-v2.mbox',
'03cc8929c3329def1ffa91ef9964c600')
'826f03a224083df013a2b373459527a3')
else:
self.check_mbox("/series/%s/revisions/1/mbox/" % self.series.pk,
'for_each_-intel_-crtc-v2.mbox',
......@@ -264,7 +264,7 @@ class APITest(APITestBase):
self.check_mbox("/series/%s/revisions/1/mbox_with_cover/" %
self.series.pk,
'for_each_-intel_-crtc-v2.mbox',
'436881bbd9020928be0f1c2aafa7d74e')
'3921b55a5ac3fb28eea0c4e198406cca')
def _check_mbox_link(self, url, n):
response = self.client.get('/api/1.0' + url, {'link': 'Patchwork'})
......
......@@ -259,6 +259,8 @@ a series introducing macros to iterate through the CRTCs instead of using
list_for_each_entry() and mode_config.crtc_list, a tiny bit more readable and
easier to recall.
Some random diff:
Damien Lespiau (4):
drm/i915: Introduce a for_each_intel_crtc() macro
drm/i915: Use for_each_intel_crtc() when iterating through intel_crtcs
......@@ -281,6 +283,22 @@ a series introducing macros to iterate through the CRTCs instead of using
list_for_each_entry() and mode_config.crtc_list, a tiny bit more readable and
easier to recall.
Some random diff:
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 8885455..edf7299 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -163,6 +163,9 @@ enum hpd_pin {
#define for_each_pipe(p) for ((p) = 0; (p) < INTEL_INFO(dev)->num_pipes; (p)++)
#define for_each_sprite(p, s) for ((s) = 0; (s) < INTEL_INFO(dev)->num_sprites[(p)]; (s)++)
+#define for_each_intel_crtc(dev, intel_crtc) \\
+ list_for_each_entry(intel_crtc, &dev->mode_config.crtc_list, base.head)
+
#define for_each_encoder_on_crtc(dev, __crtc, intel_encoder) \\
list_for_each_entry((intel_encoder), &(dev)->mode_config.encoder_list, base.head) \\
if ((intel_encoder)->base.crtc == (__crtc))
Damien Lespiau (4):
drm/i915: Introduce a for_each_intel_crtc() macro
drm/i915: Use for_each_intel_crtc() when iterating through intel_crtcs
......
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