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:
Jason Ge
2012-01-12 16:56:07 -08:00
parent bfbe6ec594
commit cf35a640ec
2 changed files with 12 additions and 0 deletions

View File

@@ -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':

View File

@@ -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}'!");