In certain cases, the shortlog for a patch would include branch and
'PATCH' tag information even after the repo tag got stripped out,
padding it with data that wouldn't actually be included with a merge.
This caused the patchtest test_shortlog_length test to erroneously
report a failure.
For example, a patch whose shortlog tags were:
[OE-core][master/scarthgap][PATCH]
would leave this behind in the shortlog, along with the actual content:
[master/scarthgap][PATCH]
Add a re.sub() call in the test to fix this by removing all square
bracket pairs that appear at the beginning of the string.
Fixes [YOCTO #15575].
Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
import parse_shortlog
import parse_signed_off_by
import pyparsing
+import re
import subprocess
from data import PatchTestInput
def test_shortlog_length(self):
for commit in TestMbox.commits:
# no reason to re-check on revert shortlogs
- shortlog = commit.shortlog
+ shortlog = re.sub('^(\[.*?\])+ ', '', commit.shortlog)
if shortlog.startswith('Revert "'):
continue
l = len(shortlog)