Hi, I was looking at how patchwork deals with pull requests and noticed that when it parses a message containing both a pull request and a patch, it will create two Patch() instances (one with the patch as its content and the other without content but with a pull_url):
if patchbuf:
mail_headers(mail)
name = clean_subject(mail.get('Subject'), [project.linkname])
patch = Patch(name = name, content = patchbuf,
date = mail_date(mail), headers = mail_headers(mail))
if pullurl:
name = clean_subject(mail.get('Subject'), [project.linkname])
patch = Patch(name = name, pull_url = pullurl,
date = mail_date(mail), headers = mail_headers(mail))
However, these are not automatically inserted in the DB, so only the
second ends up being saved.
I think it would make sense to create a single Patch() instance in this
case with both a pull_url and the patch content (although it may be
necessary to change the template to render such a patch correctly). Is
there anything that would prevent that from working?
Oh, and another issue I found is that the existing pull-request regex
doesn't catch pull requests like this:
<https://patchwork.kernel.org/patch/534761/>. Would it make sense to
have a more generic regex or maybe a list of regexes?
Cheers,
--
Guilherme Salgado <https://launchpad.net/~salgado>
signature.asc
Description: This is a digitally signed message part
_______________________________________________ Patchwork mailing list [email protected] https://lists.ozlabs.org/listinfo/patchwork
