From fbd41e42190ff8bf11222a66bf787a6a38a38208 Mon Sep 17 00:00:00 2001 From: vrana Date: Thu, 21 Feb 2013 03:10:02 -0800 Subject: [PATCH] Move revisions without reviewers to author's queue Summary: If the revision doesn't have reviewers then it's really not waiting on someone else and the author must take an action. An improvement would be to check if the reviewers are not disabled but that would require loading their handles. Test Plan: / /differential/ Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin, s.o.butler Differential Revision: https://secure.phabricator.com/D5046 --- .../application/PhabricatorApplicationDifferential.php | 1 + .../differential/query/DifferentialRevisionQuery.php | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/applications/differential/application/PhabricatorApplicationDifferential.php b/src/applications/differential/application/PhabricatorApplicationDifferential.php index a198b98d59..3a41d9f925 100644 --- a/src/applications/differential/application/PhabricatorApplicationDifferential.php +++ b/src/applications/differential/application/PhabricatorApplicationDifferential.php @@ -77,6 +77,7 @@ final class PhabricatorApplicationDifferential extends PhabricatorApplication { $revisions = id(new DifferentialRevisionQuery()) ->withResponsibleUsers(array($user->getPHID())) ->withStatus(DifferentialRevisionQuery::STATUS_OPEN) + ->needRelationships(true) ->execute(); list($blocking, $active, $waiting) = diff --git a/src/applications/differential/query/DifferentialRevisionQuery.php b/src/applications/differential/query/DifferentialRevisionQuery.php index 461ffd288d..02975b5b4a 100644 --- a/src/applications/differential/query/DifferentialRevisionQuery.php +++ b/src/applications/differential/query/DifferentialRevisionQuery.php @@ -903,6 +903,9 @@ final class DifferentialRevisionQuery { foreach ($revisions as $revision) { $needs_review = ($revision->getStatus() == $status_review); $filter_is_author = in_array($revision->getAuthorPHID(), $user_phids); + if (!$revision->getReviewers()) { + $needs_review = false; + } // If exactly one of "needs review" and "the user is the author" is // true, the user needs to act on it. Otherwise, they're waiting on