[PATCH v3 10/12] parsemail: Handle cover letters sent in reply

Andy Doan andy.doan at linaro.org
Fri Apr 15 01:56:34 AEST 2016

On 04/11/2016 04:09 PM, Stephen Finucane wrote:
> Some people send cover letters (and therefore series) as replies to
> existing series. Apply a second set of heuristics to cover this case:
> * The message contains a '[0/n]' marker tag in the subject
> * The message is not the root message, but the subject is unique, i.e.
>    it is not a reply to a cover letter already stored in Patchwork
> It is theoretically possible that the message could be a reply to a
> cover letter that's been missed, but such occurences should be rare
> and only get rarer the longer an instance is running.
> Note that there is a third case which is not yet covered: a cover
> letter with the same name but a different number of patches. This
> will have to wait until series support is fully implemented.
> Signed-off-by: Stephen Finucane <stephen.finucane at intel.com>

Reviewed-by: Andy Doan <andy.doan at linaro.org>

> ---
> v2: Only save author if we're saving a cover letter
> v3: Handle a reply being reparsed as a cover letter
> v4: Fix pep8 issues
> ---
>   patchwork/bin/parsemail.py | 65 ++++++++++++++++++++++++++++++++++------------
>   1 file changed, 48 insertions(+), 17 deletions(-)
> diff --git a/patchwork/bin/parsemail.py b/patchwork/bin/parsemail.py

> @@ -525,7 +556,7 @@ def parse_mail(mail, list_id=None):
>           author.save()
>       comment = Comment(
> -        submission=patch,
> +        submission=submission,
>           msgid=msgid,
>           date=date,
>           headers=headers,

I assume this is just a fix that got missed in a prior patch, right?

More information about the Patchwork mailing list