mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-04 13:30:11 +01:00
pick-ui: fix parsing of multiple backport-to: lines
Cc: mesa-stable Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34117>
This commit is contained in:
parent
f8d07396fa
commit
e7b2eda39d
2 changed files with 24 additions and 14 deletions
|
|
@ -292,11 +292,12 @@ async def resolve_nomination(commit: 'Commit', version: str) -> 'Commit':
|
|||
commit.nominated = True
|
||||
return commit
|
||||
|
||||
if backport_to := IS_BACKPORT.search(commit_message):
|
||||
if version in backport_to.groups():
|
||||
commit.nominated = True
|
||||
commit.nomination_type = NominationType.BACKPORT
|
||||
return commit
|
||||
if backport_to := IS_BACKPORT.findall(commit_message):
|
||||
for match in backport_to:
|
||||
if version in match:
|
||||
commit.nominated = True
|
||||
commit.nomination_type = NominationType.BACKPORT
|
||||
return commit
|
||||
|
||||
if cc_to := IS_CC.search(commit_message):
|
||||
if cc_to.groups() == (None, None) or version in cc_to.groups():
|
||||
|
|
|
|||
|
|
@ -262,9 +262,8 @@ class TestRE:
|
|||
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
|
||||
""")
|
||||
|
||||
backport_to = core.IS_BACKPORT.search(message)
|
||||
assert backport_to is not None
|
||||
assert backport_to.groups() == ('19.2', None)
|
||||
backport_to = core.IS_BACKPORT.findall(message)
|
||||
assert backport_to == [('19.2', '')]
|
||||
|
||||
def test_multiple_release_space(self):
|
||||
"""Tests commit with more than one branch specified"""
|
||||
|
|
@ -278,9 +277,8 @@ class TestRE:
|
|||
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
|
||||
""")
|
||||
|
||||
backport_to = core.IS_BACKPORT.search(message)
|
||||
assert backport_to is not None
|
||||
assert backport_to.groups() == ('19.1', '19.2')
|
||||
backport_to = core.IS_BACKPORT.findall(message)
|
||||
assert backport_to == [('19.1', '19.2')]
|
||||
|
||||
def test_multiple_release_comma(self):
|
||||
"""Tests commit with more than one branch specified"""
|
||||
|
|
@ -294,9 +292,20 @@ class TestRE:
|
|||
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
|
||||
""")
|
||||
|
||||
backport_to = core.IS_BACKPORT.search(message)
|
||||
assert backport_to is not None
|
||||
assert backport_to.groups() == ('19.1', '19.2')
|
||||
backport_to = core.IS_BACKPORT.findall(message)
|
||||
assert backport_to == [('19.1', '19.2')]
|
||||
|
||||
def test_multiple_release_lines(self):
|
||||
"""Tests commit with more than one branch specified in mulitple tags"""
|
||||
message = textwrap.dedent("""\
|
||||
commit title
|
||||
|
||||
Backport-to: 19.0
|
||||
Backport-to: 19.1, 19.2
|
||||
""")
|
||||
|
||||
backport_to = core.IS_BACKPORT.findall(message)
|
||||
assert backport_to == [('19.0', ''), ('19.1', '19.2')]
|
||||
|
||||
|
||||
class TestResolveNomination:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue