diff --git a/resources/celerity/map.php b/resources/celerity/map.php index 8343d9526c..aec7734a63 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -13,7 +13,7 @@ return array( 'differential.pkg.css' => '2de124c9', 'differential.pkg.js' => '64e69521', 'diffusion.pkg.css' => 'f45955ed', - 'diffusion.pkg.js' => 'ca1c8b5a', + 'diffusion.pkg.js' => '3a9a8bfa', 'maniphest.pkg.css' => '4845691a', 'maniphest.pkg.js' => '949a7498', 'rsrc/css/aphront/aphront-bars.css' => '231ac33c', @@ -391,7 +391,7 @@ return array( 'rsrc/js/application/diffusion/DiffusionLocateFileSource.js' => 'b42eddc7', 'rsrc/js/application/diffusion/behavior-audit-preview.js' => 'd835b03a', 'rsrc/js/application/diffusion/behavior-commit-branches.js' => 'bdaf4d04', - 'rsrc/js/application/diffusion/behavior-commit-graph.js' => '9007c197', + 'rsrc/js/application/diffusion/behavior-commit-graph.js' => '5a0b1a64', 'rsrc/js/application/diffusion/behavior-jump-to.js' => '73d09eef', 'rsrc/js/application/diffusion/behavior-load-blame.js' => '42126667', 'rsrc/js/application/diffusion/behavior-locate-file.js' => '6d3e1947', @@ -598,7 +598,7 @@ return array( 'javelin-behavior-differential-toggle-files' => 'ca3f91eb', 'javelin-behavior-differential-user-select' => 'a8d8459d', 'javelin-behavior-diffusion-commit-branches' => 'bdaf4d04', - 'javelin-behavior-diffusion-commit-graph' => '9007c197', + 'javelin-behavior-diffusion-commit-graph' => '5a0b1a64', 'javelin-behavior-diffusion-jump-to' => '73d09eef', 'javelin-behavior-diffusion-locate-file' => '6d3e1947', 'javelin-behavior-diffusion-pull-lastmodified' => 'f01586dc', @@ -1218,6 +1218,11 @@ return array( 'javelin-vector', 'javelin-dom', ), + '5a0b1a64' => array( + 'javelin-behavior', + 'javelin-dom', + 'javelin-stratcom', + ), '5b2e3e2b' => array( 'javelin-stratcom', 'javelin-request', @@ -1523,11 +1528,6 @@ return array( 'javelin-dom', 'javelin-workflow', ), - '9007c197' => array( - 'javelin-behavior', - 'javelin-dom', - 'javelin-stratcom', - ), '901935ef' => array( 'javelin-behavior', 'javelin-dom', diff --git a/src/applications/diffusion/controller/DiffusionHistoryController.php b/src/applications/diffusion/controller/DiffusionHistoryController.php index edbce636c2..59248b7acf 100644 --- a/src/applications/diffusion/controller/DiffusionHistoryController.php +++ b/src/applications/diffusion/controller/DiffusionHistoryController.php @@ -52,6 +52,7 @@ final class DiffusionHistoryController extends DiffusionController { if ($show_graph) { $history_table->setParents($history_results['parents']); $history_table->setIsHead(!$pager->getOffset()); + $history_table->setIsTail(!$pager->getHasMorePages()); } $history_panel = new PHUIObjectBoxView(); diff --git a/src/applications/diffusion/view/DiffusionHistoryTableView.php b/src/applications/diffusion/view/DiffusionHistoryTableView.php index 314bfb435c..e62c4382c9 100644 --- a/src/applications/diffusion/view/DiffusionHistoryTableView.php +++ b/src/applications/diffusion/view/DiffusionHistoryTableView.php @@ -6,6 +6,7 @@ final class DiffusionHistoryTableView extends DiffusionView { private $revisions = array(); private $handles = array(); private $isHead; + private $isTail; private $parents; public function setHistory(array $history) { @@ -60,6 +61,11 @@ final class DiffusionHistoryTableView extends DiffusionView { return $this; } + public function setIsTail($is_tail) { + $this->isTail = $is_tail; + return $this; + } + public function render() { $drequest = $this->getDiffusionRequest(); @@ -344,6 +350,16 @@ final class DiffusionHistoryTableView extends DiffusionView { ); } + // If this is the last page in history, replace the "o" with an "x" so we + // do not draw a connecting line downward, and replace "^" with an "X" for + // repositories with exactly one commit. + if ($this->isTail && $graph) { + $last = array_pop($graph); + $last['line'] = str_replace('o', 'x', $last['line']); + $last['line'] = str_replace('^', 'X', $last['line']); + $graph[] = $last; + } + // Render into tags for the behavior. foreach ($graph as $k => $meta) { diff --git a/src/view/phui/PHUIPagerView.php b/src/view/phui/PHUIPagerView.php index 16d1f96a69..1e14522ca7 100644 --- a/src/view/phui/PHUIPagerView.php +++ b/src/view/phui/PHUIPagerView.php @@ -58,6 +58,10 @@ final class PHUIPagerView extends AphrontView { return $this->hasMorePages; } + public function getHasMorePages() { + return $this->hasMorePages; + } + public function setSurroundingPages($pages) { $this->surroundingPages = max(0, $pages); return $this; diff --git a/webroot/rsrc/js/application/diffusion/behavior-commit-graph.js b/webroot/rsrc/js/application/diffusion/behavior-commit-graph.js index 97f1de568d..a3a7c7bdf8 100644 --- a/webroot/rsrc/js/application/diffusion/behavior-commit-graph.js +++ b/webroot/rsrc/js/application/diffusion/behavior-commit-graph.js @@ -37,6 +37,7 @@ JX.behavior('diffusion-commit-graph', function(config) { // Stroke with fill (for commit circles). function fstroke(c) { + cxt.lineWidth = 1; cxt.fillStyle = color(c); cxt.strokeStyle = '#ffffff'; cxt.fill(); @@ -52,7 +53,7 @@ JX.behavior('diffusion-commit-graph', function(config) { return (col * cell) + (cell / 2); }; - var h = 30; + var h = 32; var w = cell * config.count; var canvas = JX.$N('canvas', {width: w, height: h}); @@ -117,16 +118,17 @@ JX.behavior('diffusion-commit-graph', function(config) { case 'o': case '^': case '|': - if (c == 'o' || c == '^') { - origin = xpos(jj); + case 'x': + case 'X': + + if (c !== 'X') { + cxt.beginPath(); + cxt.moveTo(xpos(jj), (c == '^' ? h/2 : 0)); + cxt.lineTo(xpos(jj), (c == 'x' ? h/2 : h)); + lstroke(jj); } - cxt.beginPath(); - cxt.moveTo(xpos(jj), (c == '^' ? h/2 : 0)); - cxt.lineTo(xpos(jj), h); - lstroke(jj); - - if (c == 'o' || c == '^') { + if (c == 'o' || c == '^' || c == 'x' || c == 'X') { cxt.beginPath(); cxt.arc(xpos(jj), h/2, 3, 0, 2 * Math.PI, true); fstroke(jj);