Changeset View
Changeset View
Standalone View
Standalone View
src/repository/graph/query/ArcanistMercurialCommitGraphQuery.php
Show First 20 Lines • Show All 60 Lines • ▼ Show 20 Lines | if ($exact_hashes !== null) { | ||||
$revsets[] = $this->joinOrRevsets($revs); | $revsets[] = $this->joinOrRevsets($revs); | ||||
} | } | ||||
$revsets = $this->joinOrRevsets($revsets); | $revsets = $this->joinOrRevsets($revsets); | ||||
$fields = array( | $fields = array( | ||||
'', // Placeholder for "encoding". | '', // Placeholder for "encoding". | ||||
'{node}', | '{node}', | ||||
'{parents}', | '{p1node} {p2node}', | ||||
'{date|rfc822date}', | '{date|rfc822date}', | ||||
'{description|utf8}', | '{desc|utf8}', | ||||
); | ); | ||||
$template = implode("\2", $fields)."\1"; | $template = implode("\2", $fields)."\1"; | ||||
$flags = array(); | $flags = array(); | ||||
$min_epoch = $this->getMinimumEpoch(); | $min_epoch = $this->getMinimumEpoch(); | ||||
$max_epoch = $this->getMaximumEpoch(); | $max_epoch = $this->getMaximumEpoch(); | ||||
Show All 38 Lines | protected function beginExecute() { | ||||
$this->queryFuture = $lines; | $this->queryFuture = $lines; | ||||
} | } | ||||
protected function continueExecute() { | protected function continueExecute() { | ||||
$graph = $this->getGraph(); | $graph = $this->getGraph(); | ||||
$lines = $this->queryFuture; | $lines = $this->queryFuture; | ||||
$limit = $this->getLimit(); | $limit = $this->getLimit(); | ||||
$no_parent = str_repeat('0', 40); | |||||
while (true) { | while (true) { | ||||
if (!$lines->valid()) { | if (!$lines->valid()) { | ||||
return false; | return false; | ||||
} | } | ||||
$line = $lines->current(); | $line = $lines->current(); | ||||
$lines->next(); | $lines->next(); | ||||
Show All 20 Lines | while (true) { | ||||
$this->seen[$hash] = $node; | $this->seen[$hash] = $node; | ||||
$node | $node | ||||
->setCommitMessage($message) | ->setCommitMessage($message) | ||||
->setCommitEpoch((int)strtotime($commit_epoch)); | ->setCommitEpoch((int)strtotime($commit_epoch)); | ||||
if (strlen($parents)) { | if (strlen($parents)) { | ||||
$parents = explode(' ', $parents); | $parents = explode(' ', $parents); | ||||
$parent_nodes = array(); | $parent_nodes = array(); | ||||
foreach ($parents as $parent) { | foreach ($parents as $parent) { | ||||
if ($parent === $no_parent) { | |||||
continue; | |||||
} | |||||
$parent_node = $graph->getNode($parent); | $parent_node = $graph->getNode($parent); | ||||
if (!$parent_node) { | if (!$parent_node) { | ||||
$parent_node = $graph->newNode($parent); | $parent_node = $graph->newNode($parent); | ||||
} | } | ||||
$parent_nodes[$parent] = $parent_node; | $parent_nodes[$parent] = $parent_node; | ||||
$parent_node->addChildNode($node); | $parent_node->addChildNode($node); | ||||
} | } | ||||
Show All 38 Lines |