out = _out.decode()
# We give precedence to fixes and cc tags over revert tags.
- if m := IS_FIX.search(out):
+ if fix_for_commit := IS_FIX.search(out):
# We set the nomination_type and because_sha here so that we can later
# check to see if this fixes another staged commit.
try:
- commit.because_sha = fixed = await full_sha(m.group(1))
+ commit.because_sha = fixed = await full_sha(fix_for_commit.group(1))
except PickUIException:
pass
else:
commit.nominated = True
return commit
- if m := IS_CC.search(out):
- if m.groups() == (None, None) or version in m.groups():
+ if cc_to := IS_CC.search(out):
+ if cc_to.groups() == (None, None) or version in cc_to.groups():
commit.nominated = True
commit.nomination_type = NominationType.CC
return commit
- if m := IS_REVERT.search(out):
+ if revert_of := IS_REVERT.search(out):
# See comment for IS_FIX path
try:
- commit.because_sha = reverted = await full_sha(m.group(1))
+ commit.because_sha = reverted = await full_sha(revert_of.group(1))
except PickUIException:
pass
else:
Reviewed-by: Jonathan Marek <jonathan@marek.ca>
""")
- m = core.IS_FIX.search(message)
- assert m is not None
- assert m.group(1) == '3d09bb390a39'
+ fix_for_commit = core.IS_FIX.search(message)
+ assert fix_for_commit is not None
+ assert fix_for_commit.group(1) == '3d09bb390a39'
class TestCC:
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
""")
- m = core.IS_CC.search(message)
- assert m is not None
- assert m.group(1) == '19.2'
+ cc_to = core.IS_CC.search(message)
+ assert cc_to is not None
+ assert cc_to.group(1) == '19.2'
def test_multiple_branches(self):
"""Tests commit with more than one branch specified"""
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
""")
- m = core.IS_CC.search(message)
- assert m is not None
- assert m.group(1) == '19.1'
- assert m.group(2) == '19.2'
+ cc_to = core.IS_CC.search(message)
+ assert cc_to is not None
+ assert cc_to.group(1) == '19.1'
+ assert cc_to.group(2) == '19.2'
def test_no_branch(self):
"""Tests commit with no branch specification"""
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
""")
- m = core.IS_CC.search(message)
- assert m is not None
+ cc_to = core.IS_CC.search(message)
+ assert cc_to is not None
def test_quotes(self):
"""Tests commit with quotes around the versions"""
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3454>
""")
- m = core.IS_CC.search(message)
- assert m is not None
- assert m.group(1) == '20.0'
+ cc_to = core.IS_CC.search(message)
+ assert cc_to is not None
+ assert cc_to.group(1) == '20.0'
def test_multiple_quotes(self):
"""Tests commit with quotes around the versions"""
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3454>
""")
- m = core.IS_CC.search(message)
- assert m is not None
- assert m.group(1) == '20.0'
- assert m.group(2) == '20.1'
+ cc_to = core.IS_CC.search(message)
+ assert cc_to is not None
+ assert cc_to.group(1) == '20.0'
+ assert cc_to.group(2) == '20.1'
def test_single_quotes(self):
"""Tests commit with quotes around the versions"""
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3454>
""")
- m = core.IS_CC.search(message)
- assert m is not None
- assert m.group(1) == '20.0'
+ cc_to = core.IS_CC.search(message)
+ assert cc_to is not None
+ assert cc_to.group(1) == '20.0'
def test_multiple_single_quotes(self):
"""Tests commit with quotes around the versions"""
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3454>
""")
- m = core.IS_CC.search(message)
- assert m is not None
- assert m.group(1) == '20.0'
- assert m.group(2) == '20.1'
+ cc_to = core.IS_CC.search(message)
+ assert cc_to is not None
+ assert cc_to.group(1) == '20.0'
+ assert cc_to.group(2) == '20.1'
class TestRevert:
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
""")
- m = core.IS_REVERT.search(message)
- assert m is not None
- assert m.group(1) == '2ca8629fa9b303e24783b76a7b3b0c2513e32fbd'
+ revert_of = core.IS_REVERT.search(message)
+ assert revert_of is not None
+ assert revert_of.group(1) == '2ca8629fa9b303e24783b76a7b3b0c2513e32fbd'
class TestResolveNomination: