Page MenuHomePhabricator

D18395.diff
No OneTemporary

D18395.diff

diff --git a/src/applications/differential/controller/DifferentialDiffViewController.php b/src/applications/differential/controller/DifferentialDiffViewController.php
--- a/src/applications/differential/controller/DifferentialDiffViewController.php
+++ b/src/applications/differential/controller/DifferentialDiffViewController.php
@@ -177,7 +177,7 @@
$revisions = id(new DifferentialRevisionQuery())
->setViewer($viewer)
->withAuthors(array($viewer->getPHID()))
- ->withStatus(DifferentialLegacyQuery::STATUS_OPEN)
+ ->withIsOpen(true)
->requireCapabilities(
array(
PhabricatorPolicyCapability::CAN_VIEW,
diff --git a/src/applications/differential/controller/DifferentialRevisionViewController.php b/src/applications/differential/controller/DifferentialRevisionViewController.php
--- a/src/applications/differential/controller/DifferentialRevisionViewController.php
+++ b/src/applications/differential/controller/DifferentialRevisionViewController.php
@@ -808,7 +808,7 @@
$query = id(new DifferentialRevisionQuery())
->setViewer($this->getRequest()->getUser())
- ->withStatus(DifferentialLegacyQuery::STATUS_OPEN)
+ ->withIsOpen(true)
->withUpdatedEpochBetween($recent, null)
->setOrder(DifferentialRevisionQuery::ORDER_MODIFIED)
->setLimit(10)
diff --git a/src/applications/differential/query/DifferentialRevisionQuery.php b/src/applications/differential/query/DifferentialRevisionQuery.php
--- a/src/applications/differential/query/DifferentialRevisionQuery.php
+++ b/src/applications/differential/query/DifferentialRevisionQuery.php
@@ -26,6 +26,7 @@
private $updatedEpochMin;
private $updatedEpochMax;
private $statuses;
+ private $isOpen;
const ORDER_MODIFIED = 'order-modified';
const ORDER_CREATED = 'order-created';
@@ -152,6 +153,11 @@
return $this;
}
+ public function withIsOpen($is_open) {
+ $this->isOpen = $is_open;
+ return $this;
+ }
+
/**
* Filter results to revisions on given branches.
@@ -718,6 +724,20 @@
DifferentialLegacyQuery::getLegacyValues($this->statuses));
}
+ if ($this->isOpen !== null) {
+ if ($this->isOpen) {
+ $statuses = DifferentialLegacyQuery::getQueryValues(
+ DifferentialLegacyQuery::STATUS_OPEN);
+ } else {
+ $statuses = DifferentialLegacyQuery::getQueryValues(
+ DifferentialLegacyQuery::STATUS_CLOSED);
+ }
+ $where[] = qsprintf(
+ $conn_r,
+ 'r.status in (%Ls)',
+ $statuses);
+ }
+
$where[] = $this->buildWhereClauseParts($conn_r);
return $this->formatWhereClause($where);
}
diff --git a/src/applications/differential/query/DifferentialRevisionSearchEngine.php b/src/applications/differential/query/DifferentialRevisionSearchEngine.php
--- a/src/applications/differential/query/DifferentialRevisionSearchEngine.php
+++ b/src/applications/differential/query/DifferentialRevisionSearchEngine.php
@@ -268,7 +268,7 @@
$blocking_revisions = id(new DifferentialRevisionQuery())
->setViewer($viewer)
->withPHIDs($revision_phids)
- ->withStatus(DifferentialLegacyQuery::STATUS_OPEN)
+ ->withIsOpen(true)
->execute();
$blocking_revisions = mpull($blocking_revisions, null, 'getPHID');
diff --git a/src/applications/diffusion/controller/DiffusionBrowseController.php b/src/applications/diffusion/controller/DiffusionBrowseController.php
--- a/src/applications/diffusion/controller/DiffusionBrowseController.php
+++ b/src/applications/diffusion/controller/DiffusionBrowseController.php
@@ -1758,7 +1758,7 @@
$revisions = id(new DifferentialRevisionQuery())
->setViewer($viewer)
->withPath($repository->getID(), $path_id)
- ->withStatus(DifferentialLegacyQuery::STATUS_OPEN)
+ ->withIsOpen(true)
->withUpdatedEpochBetween($recent, null)
->setOrder(DifferentialRevisionQuery::ORDER_MODIFIED)
->setLimit(10)

File Metadata

Mime Type
text/plain
Expires
Wed, Jan 22, 9:34 AM (4 h, 36 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7025879
Default Alt Text
D18395.diff (3 KB)

Event Timeline