Page MenuHomePhabricator

D17279.id41571.diff
No OneTemporary

D17279.id41571.diff

diff --git a/src/applications/audit/query/PhabricatorCommitSearchEngine.php b/src/applications/audit/query/PhabricatorCommitSearchEngine.php
--- a/src/applications/audit/query/PhabricatorCommitSearchEngine.php
+++ b/src/applications/audit/query/PhabricatorCommitSearchEngine.php
@@ -49,6 +49,10 @@
$query->withPackagePHIDs($map['packagePHIDs']);
}
+ if ($map['unreachable'] !== null) {
+ $query->withUnreachable($map['unreachable']);
+ }
+
return $query;
}
@@ -88,6 +92,17 @@
->setConduitKey('packages')
->setAliases(array('package', 'packages', 'packagePHID'))
->setDatasource(new PhabricatorOwnersPackageDatasource()),
+ id(new PhabricatorSearchThreeStateField())
+ ->setLabel(pht('Unreachable'))
+ ->setKey('unreachable')
+ ->setOptions(
+ pht('(Show All)'),
+ pht('Show Only Unreachable Commits'),
+ pht('Hide Unreachable Commits'))
+ ->setDescription(
+ pht(
+ 'Find or exclude unreachable commits which are not ancestors of '.
+ 'any branch, tag, or ref.')),
);
}
@@ -126,7 +141,8 @@
$query
->setParameter('responsiblePHIDs', array($viewer_phid))
->setParameter('statuses', $open)
- ->setParameter('bucket', $bucket_key);
+ ->setParameter('bucket', $bucket_key)
+ ->setParameter('unreachable', false);
return $query;
case 'authored':
$query
diff --git a/src/applications/audit/view/PhabricatorAuditListView.php b/src/applications/audit/view/PhabricatorAuditListView.php
--- a/src/applications/audit/view/PhabricatorAuditListView.php
+++ b/src/applications/audit/view/PhabricatorAuditListView.php
@@ -140,6 +140,7 @@
->setObjectName($commit_name)
->setHeader($commit_desc)
->setHref($commit_link)
+ ->setDisabled($commit->isUnreachable())
->addByline(pht('Author: %s', $author_name))
->addIcon('none', $committed);
diff --git a/src/applications/diffusion/query/DiffusionCommitQuery.php b/src/applications/diffusion/query/DiffusionCommitQuery.php
--- a/src/applications/diffusion/query/DiffusionCommitQuery.php
+++ b/src/applications/diffusion/query/DiffusionCommitQuery.php
@@ -14,6 +14,7 @@
private $responsiblePHIDs;
private $statuses;
private $packagePHIDs;
+ private $unreachable;
private $needAuditRequests;
private $auditIDs;
@@ -130,6 +131,11 @@
return $this;
}
+ public function withUnreachable($unreachable) {
+ $this->unreachable = $unreachable;
+ return $this;
+ }
+
public function withStatuses(array $statuses) {
$this->statuses = $statuses;
return $this;
@@ -503,6 +509,21 @@
$this->packagePHIDs);
}
+ if ($this->unreachable !== null) {
+ if ($this->unreachable) {
+ $where[] = qsprintf(
+ $conn,
+ '(commit.importStatus & %d) = %d',
+ PhabricatorRepositoryCommit::IMPORTED_UNREACHABLE,
+ PhabricatorRepositoryCommit::IMPORTED_UNREACHABLE);
+ } else {
+ $where[] = qsprintf(
+ $conn,
+ '(commit.importStatus & %d) = 0',
+ PhabricatorRepositoryCommit::IMPORTED_UNREACHABLE);
+ }
+ }
+
return $where;
}
diff --git a/src/applications/diffusion/query/DiffusionCommitRequiredActionResultBucket.php b/src/applications/diffusion/query/DiffusionCommitRequiredActionResultBucket.php
--- a/src/applications/diffusion/query/DiffusionCommitRequiredActionResultBucket.php
+++ b/src/applications/diffusion/query/DiffusionCommitRequiredActionResultBucket.php
@@ -128,6 +128,10 @@
$should_audit = array_fuse($should_audit);
foreach ($objects as $key => $object) {
+ if (isset($phids[$object->getAuthorPHID()])) {
+ continue;
+ }
+
if (!$this->hasAuditorsWithStatus($object, $phids, $should_audit)) {
continue;
}

File Metadata

Mime Type
text/plain
Expires
Sat, Mar 29, 8:10 AM (6 d, 15 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7309397
Default Alt Text
D17279.id41571.diff (3 KB)

Event Timeline