Page MenuHomePhabricator

D17211.id41398.diff
No OneTemporary

D17211.id41398.diff

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

Mime Type
text/plain
Expires
Sun, May 12, 12:14 PM (3 w, 4 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6281253
Default Alt Text
D17211.id41398.diff (2 KB)

Event Timeline