1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-19 03:50:54 +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:
epriestley 2012-01-25 14:50:34 -08:00
parent 5b463e634c
commit dbd91d6818
4 changed files with 16 additions and 7 deletions

View file

@ -32,6 +32,8 @@ class ConduitAPI_differential_query_Method extends ConduitAPIMethod {
$status_types = array(
DifferentialRevisionQuery::STATUS_ANY,
DifferentialRevisionQuery::STATUS_OPEN,
DifferentialRevisionQuery::STATUS_ACCEPTED,
DifferentialRevisionQuery::STATUS_COMMITTED,
);
$status_types = implode(', ', $status_types);

View file

@ -37,6 +37,7 @@ final class DifferentialRevisionQuery {
private $status = 'status-any';
const STATUS_ANY = 'status-any';
const STATUS_OPEN = 'status-open';
const STATUS_ACCEPTED = 'status-accepted';
const STATUS_COMMITTED = 'status-committed';
private $authors = array();
@ -640,6 +641,14 @@ final class DifferentialRevisionQuery {
ArcanistDifferentialRevisionStatus::ACCEPTED,
));
break;
case self::STATUS_ACCEPTED:
$where[] = qsprintf(
$conn_r,
'status IN (%Ld)',
array(
ArcanistDifferentialRevisionStatus::ACCEPTED,
));
break;
case self::STATUS_COMMITTED:
$where[] = qsprintf(
$conn_r,

View file

@ -139,7 +139,7 @@ class DifferentialChangesetListView extends AphrontView {
$meta['rightURI'] = (string)$detail_uri->alter('view', 'new');
}
if ($this->user) {
if ($this->user && $repository) {
$path = ltrim(
$changeset->getAbsoluteRepositoryPath($this->diff, $repository),
'/');

View file

@ -180,8 +180,6 @@ class HeraldEngine {
implode(', ', $sql));
}
}
die("DERP");
}
public function getTranscript() {