Enable filtering for committed revisions
Summary: engineers requested to supporting filtering by 'committed' revisions, and I think it makes sense. Test Plan: verified that all the three options worked Reviewers: epriestley, btrahan, nh Reviewed By: nh CC: nh, wolffiex, aran Differential Revision: https://secure.phabricator.com/D1383
This commit is contained in:
@@ -316,6 +316,7 @@ class DifferentialRevisionListController extends DifferentialController {
|
|||||||
array(
|
array(
|
||||||
'all' => 'All',
|
'all' => 'All',
|
||||||
'open' => 'Open',
|
'open' => 'Open',
|
||||||
|
'committed' => 'Committed',
|
||||||
),
|
),
|
||||||
$params['status'],
|
$params['status'],
|
||||||
$uri,
|
$uri,
|
||||||
@@ -348,6 +349,8 @@ class DifferentialRevisionListController extends DifferentialController {
|
|||||||
case 'status':
|
case 'status':
|
||||||
if ($params['status'] == 'open') {
|
if ($params['status'] == 'open') {
|
||||||
$query->withStatus(DifferentialRevisionQuery::STATUS_OPEN);
|
$query->withStatus(DifferentialRevisionQuery::STATUS_OPEN);
|
||||||
|
} elseif ($params['status'] == 'committed') {
|
||||||
|
$query->withStatus(DifferentialRevisionQuery::STATUS_COMMITTED);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'order':
|
case 'order':
|
||||||
|
|||||||
@@ -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_COMMITTED = 'status-committed';
|
||||||
|
|
||||||
private $authors = array();
|
private $authors = array();
|
||||||
private $ccs = array();
|
private $ccs = array();
|
||||||
@@ -593,6 +594,14 @@ final class DifferentialRevisionQuery {
|
|||||||
ArcanistDifferentialRevisionStatus::ACCEPTED,
|
ArcanistDifferentialRevisionStatus::ACCEPTED,
|
||||||
));
|
));
|
||||||
break;
|
break;
|
||||||
|
case self::STATUS_COMMITTED:
|
||||||
|
$where[] = qsprintf(
|
||||||
|
$conn_r,
|
||||||
|
'status IN (%Ld)',
|
||||||
|
array(
|
||||||
|
ArcanistDifferentialRevisionStatus::COMMITTED,
|
||||||
|
));
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
throw new Exception(
|
throw new Exception(
|
||||||
"Unknown revision status filter constant '{$this->status}'!");
|
"Unknown revision status filter constant '{$this->status}'!");
|
||||||
|
|||||||
Reference in New Issue
Block a user