mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-02 19:01:03 +01:00
Fix LastModified query under SVN to ignore indirect changes.
This commit is contained in:
parent
5dea10e27c
commit
1910f43364
5 changed files with 17 additions and 3 deletions
|
@ -26,6 +26,11 @@ class DiffusionChangeController extends DiffusionController {
|
||||||
$diff_query = DiffusionDiffQuery::newFromDiffusionRequest($drequest);
|
$diff_query = DiffusionDiffQuery::newFromDiffusionRequest($drequest);
|
||||||
$changeset = $diff_query->loadChangeset();
|
$changeset = $diff_query->loadChangeset();
|
||||||
|
|
||||||
|
if (!$changeset) {
|
||||||
|
// TODO: Refine this.
|
||||||
|
return new Aphront404Response();
|
||||||
|
}
|
||||||
|
|
||||||
$changeset_view = new DifferentialChangesetListView();
|
$changeset_view = new DifferentialChangesetListView();
|
||||||
$changeset_view->setChangesets(array($changeset));
|
$changeset_view->setChangesets(array($changeset));
|
||||||
$changeset_view->setRenderURI(
|
$changeset_view->setRenderURI(
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
phutil_require_module('phabricator', 'aphront/response/404');
|
||||||
phutil_require_module('phabricator', 'applications/differential/view/changesetlistview');
|
phutil_require_module('phabricator', 'applications/differential/view/changesetlistview');
|
||||||
phutil_require_module('phabricator', 'applications/diffusion/controller/base');
|
phutil_require_module('phabricator', 'applications/diffusion/controller/base');
|
||||||
phutil_require_module('phabricator', 'applications/diffusion/query/diff/base');
|
phutil_require_module('phabricator', 'applications/diffusion/query/diff/base');
|
||||||
|
|
|
@ -22,6 +22,8 @@ abstract class DiffusionHistoryQuery {
|
||||||
private $limit = 100;
|
private $limit = 100;
|
||||||
private $offset = 0;
|
private $offset = 0;
|
||||||
|
|
||||||
|
protected $needDirectChanges;
|
||||||
|
|
||||||
final private function __construct() {
|
final private function __construct() {
|
||||||
// <private>
|
// <private>
|
||||||
}
|
}
|
||||||
|
@ -50,6 +52,11 @@ abstract class DiffusionHistoryQuery {
|
||||||
return $query;
|
return $query;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final public function needDirectChanges($direct) {
|
||||||
|
$this->needDirectChanges = $direct;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
final protected function getRequest() {
|
final protected function getRequest() {
|
||||||
return $this->request;
|
return $this->request;
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,19 +35,18 @@ final class DiffusionSvnHistoryQuery extends DiffusionHistoryQuery {
|
||||||
$paths = ipull($paths, 'id', 'path');
|
$paths = ipull($paths, 'id', 'path');
|
||||||
$path_id = $paths['/'.trim($path, '/')];
|
$path_id = $paths['/'.trim($path, '/')];
|
||||||
|
|
||||||
// TODO: isDirect junk, but note that we need indirect events for the
|
|
||||||
// svnlastmodified query!
|
|
||||||
|
|
||||||
$history_data = queryfx_all(
|
$history_data = queryfx_all(
|
||||||
$conn_r,
|
$conn_r,
|
||||||
'SELECT * FROM %T WHERE repositoryID = %d AND pathID = %d
|
'SELECT * FROM %T WHERE repositoryID = %d AND pathID = %d
|
||||||
AND commitSequence <= %d
|
AND commitSequence <= %d
|
||||||
|
%Q
|
||||||
ORDER BY commitSequence DESC
|
ORDER BY commitSequence DESC
|
||||||
LIMIT %d, %d',
|
LIMIT %d, %d',
|
||||||
PhabricatorRepository::TABLE_PATHCHANGE,
|
PhabricatorRepository::TABLE_PATHCHANGE,
|
||||||
$repository->getID(),
|
$repository->getID(),
|
||||||
$path_id,
|
$path_id,
|
||||||
$commit ? $commit : 0x7FFFFFFF,
|
$commit ? $commit : 0x7FFFFFFF,
|
||||||
|
($this->needDirectChanges ? 'AND isDirect = 1' : ''),
|
||||||
$this->getOffset(),
|
$this->getOffset(),
|
||||||
$this->getLimit());
|
$this->getLimit());
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,8 @@ final class DiffusionSvnLastModifiedQuery extends DiffusionLastModifiedQuery {
|
||||||
$history_query = DiffusionHistoryQuery::newFromDiffusionRequest(
|
$history_query = DiffusionHistoryQuery::newFromDiffusionRequest(
|
||||||
$drequest);
|
$drequest);
|
||||||
$history_query->setLimit(1);
|
$history_query->setLimit(1);
|
||||||
|
|
||||||
|
$history_query->needDirectChanges(true);
|
||||||
$history_array = $history_query->loadHistory();
|
$history_array = $history_query->loadHistory();
|
||||||
$history = reset($history_array);
|
$history = reset($history_array);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue