Diffusion - move history query to conduit
Summary: Ref T2784 Test Plan: for each flavor of VCS, I loaded up the repository home page. verified I saw some parent action where appropos. next, clicked through to 'view history' and verified it loaded up A-OK. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Maniphest Tasks: T2784 Differential Revision: https://secure.phabricator.com/D5960
This commit is contained in:
@@ -9,22 +9,21 @@ final class DiffusionHistoryController extends DiffusionController {
|
||||
$page_size = $request->getInt('pagesize', 100);
|
||||
$offset = $request->getInt('page', 0);
|
||||
|
||||
$history_query = DiffusionHistoryQuery::newFromDiffusionRequest(
|
||||
$drequest);
|
||||
$history_query->setOffset($offset);
|
||||
$history_query->setLimit($page_size + 1);
|
||||
|
||||
$params = array(
|
||||
'commit' => $drequest->getCommit(),
|
||||
'path' => $drequest->getPath(),
|
||||
'offset' => $offset,
|
||||
'limit' => $page_size + 1);
|
||||
if (!$request->getBool('copies')) {
|
||||
$history_query->needDirectChanges(true);
|
||||
$history_query->needChildChanges(true);
|
||||
$params['needDirectChanges'] = true;
|
||||
$params['needChildChanges'] = true;
|
||||
}
|
||||
|
||||
$show_graph = !strlen($drequest->getPath());
|
||||
if ($show_graph) {
|
||||
$history_query->needParents(true);
|
||||
}
|
||||
|
||||
$history = $history_query->loadHistory();
|
||||
$history_results = $this->callConduitWithDiffusionRequest(
|
||||
'diffusion.historyquery',
|
||||
$params);
|
||||
$history = DiffusionPathChange::newFromConduit(
|
||||
$history_results['pathChanges']);
|
||||
|
||||
$pager = new AphrontPagerView();
|
||||
$pager->setPageSize($page_size);
|
||||
@@ -37,6 +36,7 @@ final class DiffusionHistoryController extends DiffusionController {
|
||||
}
|
||||
$pager->setURI($request->getRequestURI(), 'page');
|
||||
|
||||
$show_graph = !strlen($drequest->getPath());
|
||||
$content = array();
|
||||
|
||||
if ($request->getBool('copies')) {
|
||||
@@ -66,7 +66,7 @@ final class DiffusionHistoryController extends DiffusionController {
|
||||
$history_table->setHandles($handles);
|
||||
|
||||
if ($show_graph) {
|
||||
$history_table->setParents($history_query->getParents());
|
||||
$history_table->setParents($history_results['parents']);
|
||||
$history_table->setIsHead($offset == 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -12,11 +12,15 @@ final class DiffusionRepositoryController extends DiffusionController {
|
||||
|
||||
$content[] = $this->buildPropertiesTable($drequest->getRepository());
|
||||
|
||||
$history_query = DiffusionHistoryQuery::newFromDiffusionRequest(
|
||||
$drequest);
|
||||
$history_query->setLimit(15);
|
||||
$history_query->needParents(true);
|
||||
$history = $history_query->loadHistory();
|
||||
$history_results = $this->callConduitWithDiffusionRequest(
|
||||
'diffusion.historyquery',
|
||||
array(
|
||||
'commit' => $drequest->getCommit(),
|
||||
'path' => $drequest->getPath(),
|
||||
'offset' => 0,
|
||||
'limit' => 15));
|
||||
$history = DiffusionPathChange::newFromConduit(
|
||||
$history_results['pathChanges']);
|
||||
|
||||
$browse_results = DiffusionBrowseResultSet::newFromConduit(
|
||||
$this->callConduitWithDiffusionRequest(
|
||||
@@ -63,7 +67,7 @@ final class DiffusionRepositoryController extends DiffusionController {
|
||||
$history_table->setHandles($handles);
|
||||
$history_table->setHistory($history);
|
||||
$history_table->loadRevisions();
|
||||
$history_table->setParents($history_query->getParents());
|
||||
$history_table->setParents($history_results['parents']);
|
||||
$history_table->setIsHead(true);
|
||||
|
||||
$callsign = $drequest->getRepository()->getCallsign();
|
||||
|
||||
Reference in New Issue
Block a user