Commit 216bfcd4 authored by Arkadiusz Hiler's avatar Arkadiusz Hiler

Do not mark revision having mails with extra tags as strange

For simple [PATCH xx/yy] we store just [xx/yy] but for more complex
[PATCH extra xx/yy] it becomes [extra, xx/yy].

Let's fix the regexp used for extracting patch numbers, so that extra
tags do not make revision strange.
Signed-off-by: Arkadiusz Hiler's avatarArkadiusz Hiler <>
parent 8a0f0baa
Pipeline #10423 failed with stage
......@@ -653,7 +653,7 @@ class SeriesRevision(models.Model):
return False
for index, name in enumerate(names):
match ="\[(\d+)/(\d+)\]", name)
match ="\[[^]]*(\d+)/(\d+).*\]", name)
if not match: # we have a patch without proper numbering
return True
if (index + 1) != int( # numbering is off
......@@ -120,7 +120,8 @@ class RevisionStatus(GeneratedSeriesTest):
return list(self.series.revisions())[-1]
def setUp(self):
(self.test_series, self.mails) = self._create_series(3)
# 20 patches for multi-digit testing
(self.test_series, self.mails) = self._create_series(20)
def testFreshSeriesWithoutAllMailsShouldNotBeComple(self):
......@@ -164,6 +165,17 @@ class RevisionStatus(GeneratedSeriesTest):
def testCompleteSeriesWithExtraTagShouldNotBeStrange(self):
for mail in self.mails:
new_subject = mail['Subject'].replace('PATCH', 'PATCH extra')
mail['Subject'] = new_subject
class BasicGeneratedSeriesTests(GeneratedSeriesTest):
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