Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15415528
D17211.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D17211.diff
View Options
diff --git a/src/infrastructure/diff/view/PHUIDiffGraphView.php b/src/infrastructure/diff/view/PHUIDiffGraphView.php
--- a/src/infrastructure/diff/view/PHUIDiffGraphView.php
+++ b/src/infrastructure/diff/view/PHUIDiffGraphView.php
@@ -50,7 +50,6 @@
$thread_count = $pos;
for ($n = 0; $n < $thread_count; $n++) {
-
if (empty($threads[$n])) {
$line .= ' ';
continue;
@@ -60,7 +59,7 @@
if ($found) {
$line .= ' ';
$joins[] = $n;
- unset($threads[$n]);
+ $threads[$n] = false;
} else {
$line .= 'o';
$found = true;
@@ -114,6 +113,7 @@
if ($thread_commit == $parent) {
$found = true;
$splits[] = $idx;
+ break;
}
}
diff --git a/src/infrastructure/diff/view/__tests__/PHUIDiffGraphViewTestCase.php b/src/infrastructure/diff/view/__tests__/PHUIDiffGraphViewTestCase.php
--- a/src/infrastructure/diff/view/__tests__/PHUIDiffGraphViewTestCase.php
+++ b/src/infrastructure/diff/view/__tests__/PHUIDiffGraphViewTestCase.php
@@ -45,10 +45,10 @@
'^',
'|^',
'o ',
- '|^',
- '||^',
- 'o ',
- 'x',
+ '| ^',
+ '| |^',
+ 'o ',
+ 'x ',
);
$this->assertGraph($picture, $graph, pht('Reverse Tree'));
@@ -71,7 +71,30 @@
'x ',
);
- $this->assertGraph($picture, $graph, pht('Reverse Tree'));
+ $this->assertGraph($picture, $graph, pht('Terminated Tree'));
+ }
+
+ public function testThreeWayGraphJoin() {
+ $nodes = array(
+ 'A' => array('D', 'C', 'B'),
+ 'B' => array('D'),
+ 'C' => array('B', 'E', 'F'),
+ 'D' => array(),
+ 'E' => array(),
+ 'F' => array(),
+ );
+
+ $graph = $this->newGraph($nodes);
+ $picture = array(
+ '^',
+ '||o',
+ '|o|',
+ 'x| ||',
+ ' | x|',
+ ' | x',
+ );
+
+ $this->assertGraph($picture, $graph, pht('Three-Way Tree'));
}
private function newGraph(array $nodes) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Mar 21, 6:29 AM (14 h, 17 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7675126
Default Alt Text
D17211.diff (2 KB)
Attached To
Mode
D17211: Fix an unusual nonterminating task graph node
Attached
Detach File
Event Timeline
Log In to Comment