From e636f3ed9d888726c26def44d02606b88173a1eb Mon Sep 17 00:00:00 2001 From: Stephan Kulow Date: Thu, 27 Oct 2022 13:34:04 +0200 Subject: [PATCH] Print the calculated tree for now --- lib/importer.py | 3 +-- lib/tree_builder.py | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/importer.py b/lib/importer.py index 03f2df2..82e21ac 100644 --- a/lib/importer.py +++ b/lib/importer.py @@ -146,7 +146,6 @@ class Importer: tprj = root.get("project") or project tpkg = root.get("package") or package dbrev.links_to(db, tprj, tpkg) - db.conn.commit() def find_linked_revs(self, db): with db.cursor() as cur: @@ -304,7 +303,7 @@ class Importer: self.obs.request(number).import_into_db(db) db.conn.commit() - # TreeBuilder(db).build(self.package) + TreeBuilder(db).build(self.package).print() def import_all_revisions(self, gc): # Fetch all the requests and sort them. Ideally we should diff --git a/lib/tree_builder.py b/lib/tree_builder.py index c88732a..4cb6439 100644 --- a/lib/tree_builder.py +++ b/lib/tree_builder.py @@ -113,7 +113,8 @@ class TreeBuilder: break if not ended_without_merge: factory_node.merged = None - last_merge.parent = None + if last_merge: + last_merge.parent = None else: last_merge = factory_node.merged factory_node = factory_node.parent