[PATCH 01/15] parsemail: Return the list of prefixes when cleaning up the subject

Damien Lespiau damien.lespiau at intel.com
Mon Oct 19 22:09:48 AEDT 2015


On Sat, Oct 10, 2015 at 12:21:11AM +0100, Finucane, Stephen wrote:
> > The patch is a preparation step towards understanding series. It will be
> > handy to parse those prefixes, looking for 'x/n' to retrieve the order
> > of a patch in a series.
> > 
> > Signed-off-by: Damien Lespiau <damien.lespiau at intel.com>
> 
> One comments below.
> 
> Stephen
> 
> > diff --git a/patchwork/bin/parsemail.py b/patchwork/bin/parsemail.py
> > index c15564e..ae588f0 100755
> > --- a/patchwork/bin/parsemail.py
> > +++ b/patchwork/bin/parsemail.py
> > @@ -213,7 +213,8 @@ def find_content(project, mail):
> >      comment = None
> > 
> >      if pullurl or patchbuf:
> > -        name = clean_subject(mail.get('Subject'), [project.linkname])
> > +        (name, prefixes) = clean_subject(mail.get('Subject'),
> > +                                         [project.linkname])
> >          patch = Patch(name = name, pull_url = pullurl, content = patchbuf,
> >                      date = mail_date(mail), headers = mail_headers(mail))
> 
> Are we using prefixes anywhere? If not, you should replace 'prefixes'
> with '_' (unnamed variable). If it's used in a later patch (I haven’t
> read ahead) then ignore this comment.

Yes, we are. Those prefixes are getting parsed for what I call "series
markers", the "03/12" numbers in the subject prefix.

-- 
Damien


More information about the Patchwork mailing list