1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-18 12:52:42 +01:00

Fix LastModified query under SVN to ignore indirect changes.

This commit is contained in:
epriestley 2011-04-06 12:27:56 -07:00
parent 5dea10e27c
commit 1910f43364
5 changed files with 17 additions and 3 deletions

View file

@ -26,6 +26,11 @@ class DiffusionChangeController extends DiffusionController {
$diff_query = DiffusionDiffQuery::newFromDiffusionRequest($drequest);
$changeset = $diff_query->loadChangeset();
if (!$changeset) {
// TODO: Refine this.
return new Aphront404Response();
}
$changeset_view = new DifferentialChangesetListView();
$changeset_view->setChangesets(array($changeset));
$changeset_view->setRenderURI(

View file

@ -6,6 +6,7 @@
phutil_require_module('phabricator', 'aphront/response/404');
phutil_require_module('phabricator', 'applications/differential/view/changesetlistview');
phutil_require_module('phabricator', 'applications/diffusion/controller/base');
phutil_require_module('phabricator', 'applications/diffusion/query/diff/base');

View file

@ -22,6 +22,8 @@ abstract class DiffusionHistoryQuery {
private $limit = 100;
private $offset = 0;
protected $needDirectChanges;
final private function __construct() {
// <private>
}
@ -50,6 +52,11 @@ abstract class DiffusionHistoryQuery {
return $query;
}
final public function needDirectChanges($direct) {
$this->needDirectChanges = $direct;
return $this;
}
final protected function getRequest() {
return $this->request;
}

View file

@ -35,19 +35,18 @@ final class DiffusionSvnHistoryQuery extends DiffusionHistoryQuery {
$paths = ipull($paths, 'id', 'path');
$path_id = $paths['/'.trim($path, '/')];
// TODO: isDirect junk, but note that we need indirect events for the
// svnlastmodified query!
$history_data = queryfx_all(
$conn_r,
'SELECT * FROM %T WHERE repositoryID = %d AND pathID = %d
AND commitSequence <= %d
%Q
ORDER BY commitSequence DESC
LIMIT %d, %d',
PhabricatorRepository::TABLE_PATHCHANGE,
$repository->getID(),
$path_id,
$commit ? $commit : 0x7FFFFFFF,
($this->needDirectChanges ? 'AND isDirect = 1' : ''),
$this->getOffset(),
$this->getLimit());

View file

@ -27,6 +27,8 @@ final class DiffusionSvnLastModifiedQuery extends DiffusionLastModifiedQuery {
$history_query = DiffusionHistoryQuery::newFromDiffusionRequest(
$drequest);
$history_query->setLimit(1);
$history_query->needDirectChanges(true);
$history_array = $history_query->loadHistory();
$history = reset($history_array);