Commit 785fba4c authored by Kadar Attila's avatar Kadar Attila Committed by Alex Vandiver
Browse files

Graphviz depth-first link traversal overzealously skips some links

The link detection algorithm uses a depth-firsth traversal of links;
unfortunately, this can lead to connections being incorrectly omitted.
If a too-long pathway is encountered prior to a short one, the "seen"
check will omit it when it is encountered later.

While switching to breadth-first would resolve this more correctly,
simply tracking the depth that the link was found at is sufficient.
parent 989a2acb
......@@ -299,9 +299,12 @@ sub TicketLinks {
}
$args{'Seen'} ||= {};
return $args{'Graph'} if $args{'Seen'}{ $args{'Ticket'}->id }++;
$self->AddTicket( %args );
if ( $args{'Seen'}{ $args{'Ticket'}->id } && $args{'Seen'}{ $args{'Ticket'}->id } <= $args{'CurrentDepth'} ) {
return $args{'Graph'};
} elsif ( ! defined $args{'Seen'}{ $args{'Ticket'}->id } ) {
$self->AddTicket( %args );
}
$args{'Seen'}{ $args{'Ticket'}->id } = $args{'CurrentDepth'};
return $args{'Graph'} if $args{'MaxDepth'} && $args{'CurrentDepth'} >= $args{'MaxDepth'};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment