Don't crash on last_node

This commit is contained in:
Stephan Kulow 2022-11-01 18:58:27 +01:00
parent b2cadb8c01
commit ab8120ca53
4 changed files with 2228 additions and 3 deletions

View File

@ -181,10 +181,11 @@ class TreeBuilder:
node = merge_before_last.merged
last_node = None
while node:
last_node = node
node = node.parent
if node and node.merged_into:
break
last_node = node
if last_node:
last_node.parent = None
if not last_merge.parent:
@ -198,4 +199,5 @@ class TreeBuilder:
self.add_merge_points(factory_revisions)
# factory_revisions.print()
self.prune_loose_end(factory_revisions)
# factory_revisions.print()
return factory_revisions

2167
tests/fixtures/CoreFreq-data.yaml vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,52 @@
- commit: openSUSE:Factory/CoreFreq/15.0
merged:
- hardware/CoreFreq/32.0
- hardware/CoreFreq/31.0
- commit: openSUSE:Factory/CoreFreq/14.0
merged:
- hardware/CoreFreq/29.0
- commit: openSUSE:Factory/CoreFreq/13.0
merged:
- hardware/CoreFreq/27.0
- hardware/CoreFreq/26.0
- commit: openSUSE:Factory/CoreFreq/12.0
merged:
- hardware/CoreFreq/25.0
- hardware/CoreFreq/24.0
- commit: openSUSE:Factory/CoreFreq/11.0
merged:
- hardware/CoreFreq/23.0
- commit: openSUSE:Factory/CoreFreq/10.0
merged:
- hardware/CoreFreq/22.0
- commit: openSUSE:Factory/CoreFreq/9.0
merged:
- hardware/CoreFreq/21.0
- commit: openSUSE:Factory/CoreFreq/8.0
merged:
- hardware/CoreFreq/20.0
- commit: openSUSE:Factory/CoreFreq/7.0
merged:
- hardware/CoreFreq/18.0
- commit: openSUSE:Factory/CoreFreq/6.0
merged:
- hardware/CoreFreq/16.0
- hardware/CoreFreq/15.0
- commit: openSUSE:Factory/CoreFreq/5.0
merged:
- hardware/CoreFreq/13.0
- commit: openSUSE:Factory/CoreFreq/4.0
merged:
- hardware/CoreFreq/11.0
- commit: openSUSE:Factory/CoreFreq/3.0
merged:
- hardware/CoreFreq/9.0
- hardware/CoreFreq/8.0
- hardware/CoreFreq/7.0
- hardware/CoreFreq/6.0
- commit: openSUSE:Factory/CoreFreq/2.0
merged:
- hardware/CoreFreq/4.0
- commit: openSUSE:Factory/CoreFreq/1.0
- commit: hardware/CoreFreq/2.0
- commit: hardware/CoreFreq/1.0

View File

@ -45,5 +45,9 @@ class TestTreeMethods(unittest.TestCase):
def test_2048_cli_tree(self):
self.verify_package("2048-cli")
def test_corefreq_tree(self):
self.verify_package("CoreFreq")
if __name__ == "__main__":
unittest.main()