Page MenuHomePhabricator

D12158.diff
No OneTemporary

D12158.diff

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
@@ -780,9 +780,12 @@
return array();
}
+ $recent = (PhabricatorTime::getNow() - phutil_units('30 days in seconds'));
+
$query = id(new DifferentialRevisionQuery())
->setViewer($this->getRequest()->getUser())
->withStatus(DifferentialRevisionQuery::STATUS_OPEN)
+ ->withUpdatedEpochBetween($recent, null)
->setOrder(DifferentialRevisionQuery::ORDER_PATH_MODIFIED)
->setLimit(10)
->needFlags(true)
@@ -807,13 +810,17 @@
private function renderOtherRevisions(array $revisions) {
assert_instances_of($revisions, 'DifferentialRevision');
+ $viewer = $this->getViewer();
- $user = $this->getRequest()->getUser();
+ $header = id(new PHUIHeaderView())
+ ->setHeader(pht('Similar Open Revisions'))
+ ->setSubheader(
+ pht('Recently updated open revisions affecting the same files.'));
$view = id(new DifferentialRevisionListView())
- ->setHeader(pht('Open Revisions Affecting These Files'))
+ ->setHeader($header)
->setRevisions($revisions)
- ->setUser($user);
+ ->setUser($viewer);
$phids = $view->getRequiredHandlePHIDs();
$handles = $this->loadViewerHandles($phids);
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
@@ -38,6 +38,8 @@
private $branches = array();
private $arcanistProjectPHIDs = array();
private $repositoryPHIDs;
+ private $updatedEpochMin;
+ private $updatedEpochMax;
private $order = 'order-modified';
const ORDER_MODIFIED = 'order-modified';
@@ -253,6 +255,12 @@
return $this;
}
+ public function withUpdatedEpochBetween($min, $max) {
+ $this->updatedEpochMin = $min;
+ $this->updatedEpochMax = $max;
+ return $this;
+ }
+
/**
* Set result ordering. Provide a class constant, such as
@@ -764,6 +772,20 @@
$this->arcanistProjectPHIDs);
}
+ if ($this->updatedEpochMin !== null) {
+ $where[] = qsprintf(
+ $conn_r,
+ 'r.dateModified >= %d',
+ $this->updatedEpochMin);
+ }
+
+ if ($this->updatedEpochMax !== null) {
+ $where[] = qsprintf(
+ $conn_r,
+ 'r.dateModified <= %d',
+ $this->updatedEpochMax);
+ }
+
switch ($this->status) {
case self::STATUS_ANY:
break;
diff --git a/src/applications/differential/view/DifferentialRevisionListView.php b/src/applications/differential/view/DifferentialRevisionListView.php
--- a/src/applications/differential/view/DifferentialRevisionListView.php
+++ b/src/applications/differential/view/DifferentialRevisionListView.php
@@ -191,8 +191,13 @@
if ($this->header && !$this->noBox) {
$list->setFlush(true);
$list = id(new PHUIObjectBoxView())
- ->setHeaderText($this->header)
->appendChild($list);
+
+ if ($this->header instanceof PHUIHeaderView) {
+ $list->setHeader($this->header);
+ } else {
+ $list->setHeaderText($this->header);
+ }
} else {
$list->setHeader($this->header);
}
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
@@ -192,10 +192,13 @@
return null;
}
+ $recent = (PhabricatorTime::getNow() - phutil_units('30 days in seconds'));
+
$revisions = id(new DifferentialRevisionQuery())
->setViewer($user)
->withPath($repository->getID(), $path_id)
->withStatus(DifferentialRevisionQuery::STATUS_OPEN)
+ ->withUpdatedEpochBetween($recent, null)
->setOrder(DifferentialRevisionQuery::ORDER_PATH_MODIFIED)
->setLimit(10)
->needRelationships(true)
@@ -207,8 +210,13 @@
return null;
}
+ $header = id(new PHUIHeaderView())
+ ->setHeader(pht('Open Revisions'))
+ ->setSubheader(
+ pht('Recently updated open revisions affecting this file.'));
+
$view = id(new DifferentialRevisionListView())
- ->setHeader(pht('Pending Differential Revisions'))
+ ->setHeader($header)
->setRevisions($revisions)
->setUser($user);

File Metadata

Mime Type
text/plain
Expires
Wed, Dec 25, 12:06 PM (9 h, 14 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6926138
Default Alt Text
D12158.diff (4 KB)

Event Timeline