commit:     ee5abb29ef2877d0e4e0b1f183d50578a49b1a26
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 17 05:42:03 2023 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Sun Dec 17 05:42:03 2023 +0000
URL:        
https://gitweb.gentoo.org/proj/pkgcore/pkgdev.git/commit/?id=ee5abb29

bugs: handle merging of top level nodes

Resolves: https://github.com/pkgcore/pkgdev/issues/125
Resolves: https://github.com/pkgcore/pkgdev/issues/167
Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 src/pkgdev/scripts/pkgdev_bugs.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/pkgdev/scripts/pkgdev_bugs.py 
b/src/pkgdev/scripts/pkgdev_bugs.py
index a5c28a9..5d3672c 100644
--- a/src/pkgdev/scripts/pkgdev_bugs.py
+++ b/src/pkgdev/scripts/pkgdev_bugs.py
@@ -437,6 +437,7 @@ class DependencyGraph:
             assert starting_node in self.nodes
             while cycle := self._find_cycles(tuple(self.nodes), 
[starting_node]):
                 self.out.write("Found cycle: ", " -> ".join(str(n) for n in 
cycle))
+                start_nodes.difference_update(cycle)
                 new_node = self.merge_nodes(cycle)
                 if starting_node not in self.nodes:
                     starting_node = new_node

Reply via email to