Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/diff/view/PHUIDiffGraphView.php
Show First 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | foreach ($parents as $cursor => $parent_list) { | ||||
// goes on a new thread. | // goes on a new thread. | ||||
$line = ''; | $line = ''; | ||||
$found = false; | $found = false; | ||||
$pos = count($threads); | $pos = count($threads); | ||||
$thread_count = $pos; | $thread_count = $pos; | ||||
for ($n = 0; $n < $thread_count; $n++) { | for ($n = 0; $n < $thread_count; $n++) { | ||||
if (empty($threads[$n])) { | if (empty($threads[$n])) { | ||||
$line .= ' '; | $line .= ' '; | ||||
continue; | continue; | ||||
} | } | ||||
if ($threads[$n] == $cursor) { | if ($threads[$n] == $cursor) { | ||||
if ($found) { | if ($found) { | ||||
$line .= ' '; | $line .= ' '; | ||||
$joins[] = $n; | $joins[] = $n; | ||||
unset($threads[$n]); | $threads[$n] = false; | ||||
} else { | } else { | ||||
$line .= 'o'; | $line .= 'o'; | ||||
$found = true; | $found = true; | ||||
$pos = $n; | $pos = $n; | ||||
} | } | ||||
} else { | } else { | ||||
// We render a "|" for any threads which have a commit that we haven't | // We render a "|" for any threads which have a commit that we haven't | ||||
Show All 37 Lines | foreach ($parents as $cursor => $parent_list) { | ||||
// Try to find the other parent(s) in our existing threads. If we find | // Try to find the other parent(s) in our existing threads. If we find | ||||
// them, split to that thread. | // them, split to that thread. | ||||
foreach ($threads as $idx => $thread_commit) { | foreach ($threads as $idx => $thread_commit) { | ||||
if ($thread_commit == $parent) { | if ($thread_commit == $parent) { | ||||
$found = true; | $found = true; | ||||
$splits[] = $idx; | $splits[] = $idx; | ||||
break; | |||||
} | } | ||||
} | } | ||||
// If we didn't find the parent, we don't know about it yet. Find the | // If we didn't find the parent, we don't know about it yet. Find the | ||||
// first free thread and add it as the "next" commit in that thread. | // first free thread and add it as the "next" commit in that thread. | ||||
// This might create a new thread. | // This might create a new thread. | ||||
if (!$found) { | if (!$found) { | ||||
▲ Show 20 Lines • Show All 89 Lines • Show Last 20 Lines |