mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-19 13:22:42 +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;
|
||||
|
||||
protected $needDirectChanges;
|
||||
protected $needChildChanges;
|
||||
|
||||
final private function __construct() {
|
||||
// <private>
|
||||
|
@ -57,6 +58,11 @@ abstract class DiffusionHistoryQuery {
|
|||
return $this;
|
||||
}
|
||||
|
||||
final public function needChildChanges($child) {
|
||||
$this->needChildChanges = $child;
|
||||
return $this;
|
||||
}
|
||||
|
||||
final protected function getRequest() {
|
||||
return $this->request;
|
||||
}
|
||||
|
|
|
@ -35,6 +35,16 @@ final class DiffusionSvnHistoryQuery extends DiffusionHistoryQuery {
|
|||
$paths = ipull($paths, 'id', '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(
|
||||
$conn_r,
|
||||
'SELECT * FROM %T WHERE repositoryID = %d AND pathID = %d
|
||||
|
@ -46,7 +56,7 @@ final class DiffusionSvnHistoryQuery extends DiffusionHistoryQuery {
|
|||
$repository->getID(),
|
||||
$path_id,
|
||||
$commit ? $commit : 0x7FFFFFFF,
|
||||
($this->needDirectChanges ? 'AND isDirect = 1' : ''),
|
||||
$filter_query,
|
||||
$this->getOffset(),
|
||||
$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/query/history/base');
|
||||
phutil_require_module('phabricator', 'applications/repository/storage/commit');
|
||||
|
|
|
@ -27,7 +27,7 @@ final class DiffusionSvnLastModifiedQuery extends DiffusionLastModifiedQuery {
|
|||
$history_query = DiffusionHistoryQuery::newFromDiffusionRequest(
|
||||
$drequest);
|
||||
$history_query->setLimit(1);
|
||||
|
||||
$history_query->needChildChanges(true);
|
||||
$history_query->needDirectChanges(true);
|
||||
$history_array = $history_query->loadHistory();
|
||||
$history = reset($history_array);
|
||||
|
|
Loading…
Reference in a new issue