Changeset View
Changeset View
Standalone View
Standalone View
src/workflow/ArcanistMarkersWorkflow.php
Show First 20 Lines • Show All 64 Lines • ▼ Show 20 Lines | if ($disjoint_heads) { | ||||
$nodes += $disjoint_nodes; | $nodes += $disjoint_nodes; | ||||
} | } | ||||
$state_refs = array(); | $state_refs = array(); | ||||
foreach ($nodes as $node) { | foreach ($nodes as $node) { | ||||
$commit_ref = $node->getCommitRef(); | $commit_ref = $node->getCommitRef(); | ||||
$state_ref = id(new ArcanistWorkingCopyStateRef()) | $state_ref = (new ArcanistWorkingCopyStateRef()) | ||||
->setCommitRef($commit_ref); | ->setCommitRef($commit_ref); | ||||
$state_refs[$node->getCommitHash()] = $state_ref; | $state_refs[$node->getCommitHash()] = $state_ref; | ||||
} | } | ||||
$this->loadHardpoints( | $this->loadHardpoints( | ||||
$state_refs, | $state_refs, | ||||
ArcanistWorkingCopyStateRef::HARDPOINT_REVISIONREFS); | ArcanistWorkingCopyStateRef::HARDPOINT_REVISIONREFS); | ||||
▲ Show 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | foreach ($partitions as $partition_key => $partition) { | ||||
} | } | ||||
} | } | ||||
// TODO: When no parent of a set is in the node list, we should render | // TODO: When no parent of a set is in the node list, we should render | ||||
// a marker showing that the commit sequence is historic. | // a marker showing that the commit sequence is historic. | ||||
$row_lists = array(); | $row_lists = array(); | ||||
foreach ($roots as $set) { | foreach ($roots as $set) { | ||||
$view = id(new ArcanistCommitGraphSetTreeView()) | $view = (new ArcanistCommitGraphSetTreeView()) | ||||
->setRepositoryAPI($api) | ->setRepositoryAPI($api) | ||||
->setRootSet($set) | ->setRootSet($set) | ||||
->setMarkers($markers) | ->setMarkers($markers) | ||||
->setStateRefs($state_refs); | ->setStateRefs($state_refs); | ||||
$row_lists[] = $view->draw(); | $row_lists[] = $view->draw(); | ||||
} | } | ||||
$partition_lists[] = $row_lists; | $partition_lists[] = $row_lists; | ||||
} | } | ||||
$grid = id(new ArcanistGridView()); | $grid = (new ArcanistGridView()); | ||||
$grid->newColumn('marker'); | $grid->newColumn('marker'); | ||||
$grid->newColumn('commits'); | $grid->newColumn('commits'); | ||||
$grid->newColumn('status'); | $grid->newColumn('status'); | ||||
$grid->newColumn('revisions'); | $grid->newColumn('revisions'); | ||||
$grid->newColumn('messages') | $grid->newColumn('messages') | ||||
->setMinimumWidth(12); | ->setMinimumWidth(12); | ||||
foreach ($partition_lists as $row_lists) { | foreach ($partition_lists as $row_lists) { | ||||
▲ Show 20 Lines • Show All 88 Lines • ▼ Show 20 Lines | foreach ($sets as $set_id => $set) { | ||||
$partition_names[] = $max_name; | $partition_names[] = $max_name; | ||||
} else { | } else { | ||||
$has_markers = 0; | $has_markers = 0; | ||||
$max_name = ''; | $max_name = ''; | ||||
} | } | ||||
$vector = id(new PhutilSortVector()) | $vector = (new PhutilSortVector()) | ||||
->addInt($has_active) | ->addInt($has_active) | ||||
->addInt($max_epoch) | ->addInt($max_epoch) | ||||
->addInt($has_markers) | ->addInt($has_markers) | ||||
->addString($max_name); | ->addString($max_name); | ||||
$vectors[$set_id] = $vector; | $vectors[$set_id] = $vector; | ||||
} | } | ||||
Show All 18 Lines | if ($partition_names) { | ||||
$has_markers = 1; | $has_markers = 1; | ||||
natcasesort($partition_names); | natcasesort($partition_names); | ||||
$partition_name = last($partition_names); | $partition_name = last($partition_names); | ||||
} else { | } else { | ||||
$has_markers = 0; | $has_markers = 0; | ||||
$partition_name = ''; | $partition_name = ''; | ||||
} | } | ||||
$partition_vector = id(new PhutilSortVector()) | $partition_vector = (new PhutilSortVector()) | ||||
->addInt($any_active) | ->addInt($any_active) | ||||
->addInt($partition_epoch) | ->addInt($partition_epoch) | ||||
->addInt($has_markers) | ->addInt($has_markers) | ||||
->addString($partition_name); | ->addString($partition_name); | ||||
return array($sets, $partition_vector); | return array($sets, $partition_vector); | ||||
} | } | ||||
} | } |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0