From a64cd7b65fc9ecf63035bd39e41f8cac5b8dc716 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 14 Oct 2015 15:11:04 +0200 Subject: graph: 'export-graph' takes a #:reverse-edges? parameter. * guix/scripts/graph.scm (export-graph): Add #:reverse-edges? parameter and honor it. --- guix/scripts/graph.scm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/guix/scripts/graph.scm b/guix/scripts/graph.scm index 725ae42030..734a47719a 100644 --- a/guix/scripts/graph.scm +++ b/guix/scripts/graph.scm @@ -322,10 +322,12 @@ substitutes." (define* (export-graph sinks port #:key + reverse-edges? (node-type %package-node-type) (backend %graphviz-backend)) "Write to PORT the representation of the DAG with the given SINKS, using the -given BACKEND. Use NODE-TYPE to traverse the DAG." +given BACKEND. Use NODE-TYPE to traverse the DAG. When REVERSE-EDGES? is +true, draw reverse arrows." (match backend (($ emit-prologue emit-epilogue emit-node emit-edge) (emit-prologue (node-type-name node-type) port) @@ -349,7 +351,9 @@ given BACKEND. Use NODE-TYPE to traverse the DAG." dependencies))) (emit-node id (node-label head) port) (for-each (lambda (dependency dependency-id) - (emit-edge id dependency-id port)) + (if reverse-edges? + (emit-edge dependency-id id port) + (emit-edge id dependency-id port))) dependencies ids) (loop (append dependencies tail) (set-insert id visited))))))))))))) -- cgit v1.2.3