diff options
author | Zac Medico <zmedico@gentoo.org> | 2007-05-23 20:39:13 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2007-05-23 20:39:13 +0000 |
commit | 251599fe919add04678e2d8bda1dc181d83b6de6 (patch) | |
tree | 00ccc35e40b34e774e13045b213c95a1e8f5e46d /bin/emerge | |
parent | df049d9e38f5cb6109096b25431f885a668f6021 (diff) | |
download | portage-251599fe919add04678e2d8bda1dc181d83b6de6.tar.gz portage-251599fe919add04678e2d8bda1dc181d83b6de6.tar.bz2 portage-251599fe919add04678e2d8bda1dc181d83b6de6.zip |
In --tree output, keep track of which graph edges have already been displayed and try not to display a given edge more than once. (trunk r6555:6557)
svn path=/main/branches/2.1.2/; revision=6604
Diffstat (limited to 'bin/emerge')
-rwxr-xr-x | bin/emerge | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/bin/emerge b/bin/emerge index 9ae6dd10e..249f0e5a0 100755 --- a/bin/emerge +++ b/bin/emerge @@ -2340,6 +2340,7 @@ class depgraph: mygraph = self._parent_child_digraph i = 0 depth = 0 + shown_edges = set() for x in mylist: if "blocks" == x[0]: display_list.append((x, 0, True)) @@ -2354,6 +2355,7 @@ class depgraph: tree_nodes = tree_nodes[:depth] tree_nodes.append(graph_key) display_list.append((x, depth, True)) + shown_edges.add((graph_key, tree_nodes[depth-1])) else: traversed_nodes = set() # prevent endless circles traversed_nodes.add(graph_key) @@ -2366,15 +2368,22 @@ class depgraph: for node in parent_nodes: if node not in traversed_nodes and \ node not in child_nodes: + edge = (current_node, node) + if edge in shown_edges: + continue selected_parent = node break if not selected_parent: # A direct cycle is unavoidable. for node in parent_nodes: if node not in traversed_nodes: + edge = (current_node, node) + if edge in shown_edges: + continue selected_parent = node break if selected_parent: + shown_edges.add((current_node, selected_parent)) traversed_nodes.add(selected_parent) add_parents(selected_parent, False) display_list.append((list(current_node), |