Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15385831
D21380.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D21380.id.diff
View Options
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,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Mar 15, 11:30 PM (3 d, 8 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7381770
Default Alt Text
D21380.id.diff (3 KB)
Attached To
Mode
D21380: Give Mercurial more plausible marker behavior
Attached
Detach File
Event Timeline
Log In to Comment