mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-20 20:40:56 +01:00
Allow differential.query to find accepted and committed revisions; fix a fatal
Summary: - Expose existing 'committed' filter. - Add an 'accepted' filter. - Fix a fatal where $repository may not be defined (for diffs not linked to a repository). Test Plan: Ran accepted / committed queries. Viewed a previously fataling diff. Reviewers: btrahan, vrana, Makinde Reviewed By: Makinde CC: Koolvin, aran, epriestley Differential Revision: https://secure.phabricator.com/D1490
This commit is contained in:
parent
5b463e634c
commit
dbd91d6818
4 changed files with 16 additions and 7 deletions
|
@ -32,6 +32,8 @@ class ConduitAPI_differential_query_Method extends ConduitAPIMethod {
|
||||||
$status_types = array(
|
$status_types = array(
|
||||||
DifferentialRevisionQuery::STATUS_ANY,
|
DifferentialRevisionQuery::STATUS_ANY,
|
||||||
DifferentialRevisionQuery::STATUS_OPEN,
|
DifferentialRevisionQuery::STATUS_OPEN,
|
||||||
|
DifferentialRevisionQuery::STATUS_ACCEPTED,
|
||||||
|
DifferentialRevisionQuery::STATUS_COMMITTED,
|
||||||
);
|
);
|
||||||
$status_types = implode(', ', $status_types);
|
$status_types = implode(', ', $status_types);
|
||||||
|
|
||||||
|
|
|
@ -37,6 +37,7 @@ final class DifferentialRevisionQuery {
|
||||||
private $status = 'status-any';
|
private $status = 'status-any';
|
||||||
const STATUS_ANY = 'status-any';
|
const STATUS_ANY = 'status-any';
|
||||||
const STATUS_OPEN = 'status-open';
|
const STATUS_OPEN = 'status-open';
|
||||||
|
const STATUS_ACCEPTED = 'status-accepted';
|
||||||
const STATUS_COMMITTED = 'status-committed';
|
const STATUS_COMMITTED = 'status-committed';
|
||||||
|
|
||||||
private $authors = array();
|
private $authors = array();
|
||||||
|
@ -640,6 +641,14 @@ final class DifferentialRevisionQuery {
|
||||||
ArcanistDifferentialRevisionStatus::ACCEPTED,
|
ArcanistDifferentialRevisionStatus::ACCEPTED,
|
||||||
));
|
));
|
||||||
break;
|
break;
|
||||||
|
case self::STATUS_ACCEPTED:
|
||||||
|
$where[] = qsprintf(
|
||||||
|
$conn_r,
|
||||||
|
'status IN (%Ld)',
|
||||||
|
array(
|
||||||
|
ArcanistDifferentialRevisionStatus::ACCEPTED,
|
||||||
|
));
|
||||||
|
break;
|
||||||
case self::STATUS_COMMITTED:
|
case self::STATUS_COMMITTED:
|
||||||
$where[] = qsprintf(
|
$where[] = qsprintf(
|
||||||
$conn_r,
|
$conn_r,
|
||||||
|
|
|
@ -139,7 +139,7 @@ class DifferentialChangesetListView extends AphrontView {
|
||||||
$meta['rightURI'] = (string)$detail_uri->alter('view', 'new');
|
$meta['rightURI'] = (string)$detail_uri->alter('view', 'new');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->user) {
|
if ($this->user && $repository) {
|
||||||
$path = ltrim(
|
$path = ltrim(
|
||||||
$changeset->getAbsoluteRepositoryPath($this->diff, $repository),
|
$changeset->getAbsoluteRepositoryPath($this->diff, $repository),
|
||||||
'/');
|
'/');
|
||||||
|
|
|
@ -180,8 +180,6 @@ class HeraldEngine {
|
||||||
implode(', ', $sql));
|
implode(', ', $sql));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
die("DERP");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getTranscript() {
|
public function getTranscript() {
|
||||||
|
|
Loading…
Reference in a new issue