diff --git a/src/repository/api/ArcanistMercurialAPI.php b/src/repository/api/ArcanistMercurialAPI.php --- a/src/repository/api/ArcanistMercurialAPI.php +++ b/src/repository/api/ArcanistMercurialAPI.php @@ -1035,4 +1035,24 @@ return new ArcanistMercurialCommitGraphQuery(); } + protected function newPublishedCommitHashes() { + $future = $this->newFuture( + 'log --rev %s --template %s', + hgsprintf('parents(draft()) - draft()'), + '{node}\n'); + list($lines) = $future->resolve(); + + $lines = phutil_split_lines($lines, false); + + $hashes = array(); + foreach ($lines as $line) { + if (!strlen(trim($line))) { + continue; + } + $hashes[] = $line; + } + + return $hashes; + } + } diff --git a/src/repository/graph/query/ArcanistMercurialCommitGraphQuery.php b/src/repository/graph/query/ArcanistMercurialCommitGraphQuery.php --- a/src/repository/graph/query/ArcanistMercurialCommitGraphQuery.php +++ b/src/repository/graph/query/ArcanistMercurialCommitGraphQuery.php @@ -66,9 +66,9 @@ $fields = array( '', // Placeholder for "encoding". '{node}', - '{parents}', + '{p1node} {p2node}', '{date|rfc822date}', - '{description|utf8}', + '{desc|utf8}', ); $template = implode("\2", $fields)."\1"; @@ -123,6 +123,9 @@ $graph = $this->getGraph(); $lines = $this->queryFuture; $limit = $this->getLimit(); + + $no_parent = str_repeat('0', 40); + while (true) { if (!$lines->valid()) { return false; @@ -159,9 +162,12 @@ if (strlen($parents)) { $parents = explode(' ', $parents); - $parent_nodes = array(); foreach ($parents as $parent) { + if ($parent === $no_parent) { + continue; + } + $parent_node = $graph->getNode($parent); if (!$parent_node) { $parent_node = $graph->newNode($parent); diff --git a/src/workflow/ArcanistLookWorkflow.php b/src/workflow/ArcanistLookWorkflow.php --- a/src/workflow/ArcanistLookWorkflow.php +++ b/src/workflow/ArcanistLookWorkflow.php @@ -60,7 +60,7 @@ 'You stand in the middle of a small clearing in the woods.')); $now = time(); - $hour = (int)date('h', $now); + $hour = (int)date('G', $now); if ($hour >= 5 && $hour <= 7) { $time = pht( diff --git a/src/workflow/ArcanistMarkersWorkflow.php b/src/workflow/ArcanistMarkersWorkflow.php --- a/src/workflow/ArcanistMarkersWorkflow.php +++ b/src/workflow/ArcanistMarkersWorkflow.php @@ -16,7 +16,7 @@ ->withMarkerTypes(array($marker_type)) ->execute(); - $tail_hashes = $this->getTailHashes(); + $tail_hashes = $api->getPublishedCommitHashes(); $heads = mpull($markers, 'getCommitHash'); @@ -32,7 +32,6 @@ } $nodes = $query->execute(); - if (count($nodes) > $limit) { // TODO: Show what we can. @@ -168,11 +167,6 @@ return isset($types[$marker_type]); } - private function getTailHashes() { - $api = $this->getRepositoryAPI(); - return $api->getPublishedCommitHashes(); - } - private function sortSets( ArcanistCommitGraph $graph, array $sets,