mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-03 11:21:01 +01:00
Show child changes in last-modified view.
This commit is contained in:
parent
40083bfa0e
commit
e92b1fee9f
4 changed files with 19 additions and 2 deletions
|
@ -23,6 +23,7 @@ abstract class DiffusionHistoryQuery {
|
||||||
private $offset = 0;
|
private $offset = 0;
|
||||||
|
|
||||||
protected $needDirectChanges;
|
protected $needDirectChanges;
|
||||||
|
protected $needChildChanges;
|
||||||
|
|
||||||
final private function __construct() {
|
final private function __construct() {
|
||||||
// <private>
|
// <private>
|
||||||
|
@ -57,6 +58,11 @@ abstract class DiffusionHistoryQuery {
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final public function needChildChanges($child) {
|
||||||
|
$this->needChildChanges = $child;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
final protected function getRequest() {
|
final protected function getRequest() {
|
||||||
return $this->request;
|
return $this->request;
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,6 +35,16 @@ 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, '/')];
|
||||||
|
|
||||||
|
$filter_query = '';
|
||||||
|
if ($this->needDirectChanges) {
|
||||||
|
if ($this->needChildChanges) {
|
||||||
|
$type = DifferentialChangeType::TYPE_CHILD;
|
||||||
|
$filter_query = 'AND (isDirect = 1 OR changeType = '.$type.')';
|
||||||
|
} else {
|
||||||
|
$filter_query = 'AND (isDirect = 1)';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$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
|
||||||
|
@ -46,7 +56,7 @@ final class DiffusionSvnHistoryQuery extends DiffusionHistoryQuery {
|
||||||
$repository->getID(),
|
$repository->getID(),
|
||||||
$path_id,
|
$path_id,
|
||||||
$commit ? $commit : 0x7FFFFFFF,
|
$commit ? $commit : 0x7FFFFFFF,
|
||||||
($this->needDirectChanges ? 'AND isDirect = 1' : ''),
|
$filter_query,
|
||||||
$this->getOffset(),
|
$this->getOffset(),
|
||||||
$this->getLimit());
|
$this->getLimit());
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
phutil_require_module('phabricator', 'applications/differential/constants/changetype');
|
||||||
phutil_require_module('phabricator', 'applications/diffusion/data/pathchange');
|
phutil_require_module('phabricator', 'applications/diffusion/data/pathchange');
|
||||||
phutil_require_module('phabricator', 'applications/diffusion/query/history/base');
|
phutil_require_module('phabricator', 'applications/diffusion/query/history/base');
|
||||||
phutil_require_module('phabricator', 'applications/repository/storage/commit');
|
phutil_require_module('phabricator', 'applications/repository/storage/commit');
|
||||||
|
|
|
@ -27,7 +27,7 @@ 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->needChildChanges(true);
|
||||||
$history_query->needDirectChanges(true);
|
$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