All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jose Lamego <jose.a.lamego@linux.intel.com>
To: yocto@yoctoproject.org
Subject: [[patchwork][PATCH] models.py: Improve Series naming when no cover letter is provided
Date: Fri,  7 Apr 2017 10:04:18 -0500	[thread overview]
Message-ID: <1491577458-7364-1-git-send-email-jose.a.lamego@linux.intel.com> (raw)

The number/order prefix from a patch Subject line
is inapropriately included when naming a Series where
a cover letter is not provided and an additional
prefix is present at the Subject.

This change improves the substitution regex to omit
the number/order prefix but include any other prefix
that may be present.

[YOCTO #11305]

Signed-off-by: Jose Lamego <jose.a.lamego@linux.intel.com>
---
 patchwork/models.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/patchwork/models.py b/patchwork/models.py
index ddc3254..8b72f4a 100644
--- a/patchwork/models.py
+++ b/patchwork/models.py
@@ -1046,8 +1046,8 @@ def _on_revision_complete(sender, revision, **kwargs):
     # so we can update the name for series without a cover letter
     if series.name == SERIES_DEFAULT_NAME:
         name = series.latest_revision().ordered_patches()[0].name
-        n = re.compile(r'(\[\d+\/\d+\]\s?)')
-        name = n.sub('', name)
+        n = re.compile(r'(\[\s*\w*\s*v\d+)(\W*\d+\/\d+)(\s*\]\s?.)*')
+        name = n.sub(r'\g<1>\g<3>', name)
         c = len(series.latest_revision().ordered_patches())
         # For one-patch series (1/1) without cover letter
         if c == 1:
-- 
2.7.4



                 reply	other threads:[~2017-04-07 15:04 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1491577458-7364-1-git-send-email-jose.a.lamego@linux.intel.com \
    --to=jose.a.lamego@linux.intel.com \
    --cc=yocto@yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.