Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14831987
D18131.id43626.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
10 KB
Referenced Files
None
Subscribers
None
D18131.id43626.diff
View Options
diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -729,6 +729,7 @@
'DiffusionGitResponse' => 'applications/diffusion/response/DiffusionGitResponse.php',
'DiffusionGitSSHWorkflow' => 'applications/diffusion/ssh/DiffusionGitSSHWorkflow.php',
'DiffusionGitUploadPackSSHWorkflow' => 'applications/diffusion/ssh/DiffusionGitUploadPackSSHWorkflow.php',
+ 'DiffusionGraphController' => 'applications/diffusion/controller/DiffusionGraphController.php',
'DiffusionHistoryController' => 'applications/diffusion/controller/DiffusionHistoryController.php',
'DiffusionHistoryListView' => 'applications/diffusion/view/DiffusionHistoryListView.php',
'DiffusionHistoryQueryConduitAPIMethod' => 'applications/diffusion/conduit/DiffusionHistoryQueryConduitAPIMethod.php',
@@ -5706,6 +5707,7 @@
'DiffusionRepositoryClusterEngineLogInterface',
),
'DiffusionGitUploadPackSSHWorkflow' => 'DiffusionGitSSHWorkflow',
+ 'DiffusionGraphController' => 'DiffusionController',
'DiffusionHistoryController' => 'DiffusionController',
'DiffusionHistoryListView' => 'DiffusionHistoryView',
'DiffusionHistoryQueryConduitAPIMethod' => 'DiffusionQueryConduitAPIMethod',
diff --git a/src/applications/diffusion/application/PhabricatorDiffusionApplication.php b/src/applications/diffusion/application/PhabricatorDiffusionApplication.php
--- a/src/applications/diffusion/application/PhabricatorDiffusionApplication.php
+++ b/src/applications/diffusion/application/PhabricatorDiffusionApplication.php
@@ -56,6 +56,7 @@
'repository/(?P<dblob>.*)' => 'DiffusionRepositoryController',
'change/(?P<dblob>.*)' => 'DiffusionChangeController',
'history/(?P<dblob>.*)' => 'DiffusionHistoryController',
+ 'graph/(?P<dblob>.*)' => 'DiffusionGraphController',
'browse/(?P<dblob>.*)' => 'DiffusionBrowseController',
'lastmodified/(?P<dblob>.*)' => 'DiffusionLastModifiedController',
'diff/' => 'DiffusionDiffController',
diff --git a/src/applications/diffusion/controller/DiffusionController.php b/src/applications/diffusion/controller/DiffusionController.php
--- a/src/applications/diffusion/controller/DiffusionController.php
+++ b/src/applications/diffusion/controller/DiffusionController.php
@@ -204,6 +204,9 @@
case 'history':
$view_name = pht('History');
break;
+ case 'graph':
+ $view_name = pht('Graph');
+ break;
case 'browse':
$view_name = pht('Browse');
break;
diff --git a/src/applications/diffusion/controller/DiffusionHistoryController.php b/src/applications/diffusion/controller/DiffusionGraphController.php
copy from src/applications/diffusion/controller/DiffusionHistoryController.php
copy to src/applications/diffusion/controller/DiffusionGraphController.php
--- a/src/applications/diffusion/controller/DiffusionHistoryController.php
+++ b/src/applications/diffusion/controller/DiffusionGraphController.php
@@ -1,6 +1,6 @@
<?php
-final class DiffusionHistoryController extends DiffusionController {
+final class DiffusionGraphController extends DiffusionController {
public function shouldAllowPublic() {
return true;
@@ -34,67 +34,72 @@
$history = $pager->sliceResults($history);
- $history_list = id(new DiffusionHistoryListView())
+ $graph = id(new DiffusionHistoryTableView())
->setViewer($viewer)
->setDiffusionRequest($drequest)
->setHistory($history);
- $history_list->loadRevisions();
+ $graph->loadRevisions();
+ $show_graph = !strlen($drequest->getPath());
+ if ($show_graph) {
+ $graph->setParents($history_results['parents']);
+ $graph->setIsHead(!$pager->getOffset());
+ $graph->setIsTail(!$pager->getHasMorePages());
+ }
+
$header = $this->buildHeader($drequest);
$crumbs = $this->buildCrumbs(
array(
'branch' => true,
'path' => true,
- 'view' => 'history',
+ 'view' => 'graph',
));
$crumbs->setBorder(true);
$title = array(
- pht('History'),
+ pht('Graph'),
$repository->getDisplayName(),
);
- $pager = id(new PHUIBoxView())
- ->addClass('mlb')
- ->appendChild($pager);
+ $graph_view = id(new PHUIObjectBoxView())
+ ->setHeaderText(pht('History Graph'))
+ ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
+ ->setTable($graph)
+ ->setPager($pager);
$view = id(new PHUITwoColumnView())
->setHeader($header)
- ->setFooter(array(
- $history_list,
- $pager,
- ));
+ ->setFooter($graph_view);
return $this->newPage()
->setTitle($title)
->setCrumbs($crumbs)
- ->appendChild($view)
- ->addClass('diffusion-history-view');
+ ->appendChild($view);
}
private function buildHeader(DiffusionRequest $drequest) {
$viewer = $this->getViewer();
$tag = $this->renderCommitHashTag($drequest);
- $browse_uri = $drequest->generateURI(
+ $history_uri = $drequest->generateURI(
array(
- 'action' => 'browse',
+ 'action' => 'history',
));
- $browse_button = id(new PHUIButtonView())
+ $history_button = id(new PHUIButtonView())
->setTag('a')
- ->setText(pht('Browse'))
- ->setHref($browse_uri)
- ->setIcon('fa-code');
+ ->setText(pht('History'))
+ ->setHref($history_uri)
+ ->setIcon('fa-history');
$header = id(new PHUIHeaderView())
->setUser($viewer)
->setPolicyObject($drequest->getRepository())
->addTag($tag)
->setHeader($this->renderPathLinks($drequest, $mode = 'history'))
- ->setHeaderIcon('fa-clock-o')
- ->addActionLink($browse_button);
+ ->setHeaderIcon('fa-code-fork')
+ ->addActionLink($history_button);
return $header;
diff --git a/src/applications/diffusion/controller/DiffusionHistoryController.php b/src/applications/diffusion/controller/DiffusionHistoryController.php
--- a/src/applications/diffusion/controller/DiffusionHistoryController.php
+++ b/src/applications/diffusion/controller/DiffusionHistoryController.php
@@ -77,24 +77,28 @@
$viewer = $this->getViewer();
$tag = $this->renderCommitHashTag($drequest);
- $browse_uri = $drequest->generateURI(
- array(
- 'action' => 'browse',
- ));
-
- $browse_button = id(new PHUIButtonView())
- ->setTag('a')
- ->setText(pht('Browse'))
- ->setHref($browse_uri)
- ->setIcon('fa-code');
+ $show_graph = !strlen($drequest->getPath());
$header = id(new PHUIHeaderView())
->setUser($viewer)
->setPolicyObject($drequest->getRepository())
->addTag($tag)
->setHeader($this->renderPathLinks($drequest, $mode = 'history'))
- ->setHeaderIcon('fa-clock-o')
- ->addActionLink($browse_button);
+ ->setHeaderIcon('fa-clock-o');
+
+ if ($show_graph) {
+ $graph_uri = $drequest->generateURI(
+ array(
+ 'action' => 'graph',
+ ));
+
+ $graph_button = id(new PHUIButtonView())
+ ->setTag('a')
+ ->setText(pht('Graph'))
+ ->setHref($graph_uri)
+ ->setIcon('fa-code-fork');
+ $header->addActionLink($graph_button);
+ }
return $header;
diff --git a/src/applications/diffusion/controller/DiffusionRepositoryController.php b/src/applications/diffusion/controller/DiffusionRepositoryController.php
--- a/src/applications/diffusion/controller/DiffusionRepositoryController.php
+++ b/src/applications/diffusion/controller/DiffusionRepositoryController.php
@@ -451,11 +451,11 @@
$header->setSubheader(pht('Showing %d branches.', $limit));
}
- $button = new PHUIButtonView();
- $button->setText(pht('Show All'));
- $button->setTag('a');
- $button->setIcon('fa-code-fork');
- $button->setHref($drequest->generateURI(
+ $button = id(new PHUIButtonView())
+ ->setText(pht('Show All'))
+ ->setTag('a')
+ ->setIcon('fa-code-fork')
+ ->setHref($drequest->generateURI(
array(
'action' => 'branches',
)));
@@ -511,11 +511,11 @@
pht('Showing the %d most recent tags.', $tag_limit));
}
- $button = new PHUIButtonView();
- $button->setText(pht('Show All Tags'));
- $button->setTag('a');
- $button->setIcon('fa-tag');
- $button->setHref($drequest->generateURI(
+ $button = id(new PHUIButtonView())
+ ->setText(pht('Show All Tags'))
+ ->setTag('a')
+ ->setIcon('fa-tag')
+ ->setHref($drequest->generateURI(
array(
'action' => 'tags',
)));
@@ -567,23 +567,30 @@
$history_table->setIsHead(true);
- $icon = id(new PHUIIconView())
- ->setIcon('fa-list-alt');
-
- $button = id(new PHUIButtonView())
- ->setText(pht('View History'))
+ $history = id(new PHUIButtonView())
+ ->setText(pht('History'))
->setHref($drequest->generateURI(
array(
'action' => 'history',
)))
->setTag('a')
- ->setIcon($icon);
+ ->setIcon('fa-history');
+
+ $graph = id(new PHUIButtonView())
+ ->setText(pht('Graph'))
+ ->setHref($drequest->generateURI(
+ array(
+ 'action' => 'graph',
+ )))
+ ->setTag('a')
+ ->setIcon('fa-code-fork');
$panel = id(new PHUIObjectBoxView())
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY);
$header = id(new PHUIHeaderView())
->setHeader(pht('Recent Commits'))
- ->addActionLink($button);
+ ->addActionLink($graph)
+ ->addActionLink($history);
$panel->setHeader($header);
$panel->setTable($history_table);
@@ -672,14 +679,11 @@
$header = id(new PHUIHeaderView())
->setHeader($repository->getName());
- $icon = id(new PHUIIconView())
- ->setIcon('fa-folder-open');
-
- $button = new PHUIButtonView();
- $button->setText(pht('Browse Repository'));
- $button->setTag('a');
- $button->setIcon($icon);
- $button->setHref($browse_uri);
+ $button = id(new PHUIButtonView())
+ ->setText(pht('Browse'))
+ ->setTag('a')
+ ->setIcon('fa-code')
+ ->setHref($browse_uri);
$header->addActionLink($button);
$browse_panel->setHeader($header);
diff --git a/src/applications/repository/storage/PhabricatorRepository.php b/src/applications/repository/storage/PhabricatorRepository.php
--- a/src/applications/repository/storage/PhabricatorRepository.php
+++ b/src/applications/repository/storage/PhabricatorRepository.php
@@ -699,6 +699,7 @@
$action = idx($params, 'action');
switch ($action) {
case 'history':
+ case 'graph':
case 'browse':
case 'change':
case 'lastmodified':
@@ -776,6 +777,7 @@
switch ($action) {
case 'change':
case 'history':
+ case 'graph':
case 'browse':
case 'lastmodified':
case 'tags':
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jan 31, 3:46 AM (3 h, 45 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7077101
Default Alt Text
D18131.id43626.diff (10 KB)
Attached To
Mode
D18131: Add a graph view page to Diffusion
Attached
Detach File
Event Timeline
Log In to Comment