Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/query/DiffusionCommitQuery.php
| Show All 9 Lines | final class DiffusionCommitQuery | ||||
| private $identifiers; | private $identifiers; | ||||
| private $repositoryIDs; | private $repositoryIDs; | ||||
| private $repositoryPHIDs; | private $repositoryPHIDs; | ||||
| private $identifierMap; | private $identifierMap; | ||||
| private $responsiblePHIDs; | private $responsiblePHIDs; | ||||
| private $statuses; | private $statuses; | ||||
| private $packagePHIDs; | private $packagePHIDs; | ||||
| private $unreachable; | private $unreachable; | ||||
| private $unpublished; | |||||
| private $needAuditRequests; | private $needAuditRequests; | ||||
| private $needAuditAuthority; | private $needAuditAuthority; | ||||
| private $auditIDs; | private $auditIDs; | ||||
| private $auditorPHIDs; | private $auditorPHIDs; | ||||
| private $epochMin; | private $epochMin; | ||||
| private $epochMax; | private $epochMax; | ||||
| private $importing; | private $importing; | ||||
| ▲ Show 20 Lines • Show All 122 Lines • ▼ Show 20 Lines | public function withPackagePHIDs(array $package_phids) { | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function withUnreachable($unreachable) { | public function withUnreachable($unreachable) { | ||||
| $this->unreachable = $unreachable; | $this->unreachable = $unreachable; | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function withUnpublished($unpublished) { | |||||
| $this->unpublished = $unpublished; | |||||
| return $this; | |||||
| } | |||||
| public function withStatuses(array $statuses) { | public function withStatuses(array $statuses) { | ||||
| $this->statuses = $statuses; | $this->statuses = $statuses; | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function withEpochRange($min, $max) { | public function withEpochRange($min, $max) { | ||||
| $this->epochMin = $min; | $this->epochMin = $min; | ||||
| $this->epochMax = $max; | $this->epochMax = $max; | ||||
| ▲ Show 20 Lines • Show All 684 Lines • ▼ Show 20 Lines | if ($this->unreachable !== null) { | ||||
| } else { | } else { | ||||
| $where[] = qsprintf( | $where[] = qsprintf( | ||||
| $conn, | $conn, | ||||
| '(commit.importStatus & %d) = 0', | '(commit.importStatus & %d) = 0', | ||||
| PhabricatorRepositoryCommit::IMPORTED_UNREACHABLE); | PhabricatorRepositoryCommit::IMPORTED_UNREACHABLE); | ||||
| } | } | ||||
| } | } | ||||
| if ($this->unpublished !== null) { | |||||
| if ($this->unpublished) { | |||||
| $where[] = qsprintf( | |||||
| $conn, | |||||
| '(commit.importStatus & %d) = 0', | |||||
| PhabricatorRepositoryCommit::IMPORTED_CLOSEABLE); | |||||
| } else { | |||||
| $where[] = qsprintf( | |||||
| $conn, | |||||
| '(commit.importStatus & %d) = %d', | |||||
amckinley: Any reason to prefer this over `(commit.importStatus & %d) != 0`? | |||||
| PhabricatorRepositoryCommit::IMPORTED_CLOSEABLE, | |||||
| PhabricatorRepositoryCommit::IMPORTED_CLOSEABLE); | |||||
| } | |||||
| } | |||||
| return $where; | return $where; | ||||
| } | } | ||||
| protected function didFilterResults(array $filtered) { | protected function didFilterResults(array $filtered) { | ||||
| if ($this->identifierMap) { | if ($this->identifierMap) { | ||||
| foreach ($this->identifierMap as $name => $commit) { | foreach ($this->identifierMap as $name => $commit) { | ||||
| if (isset($filtered[$commit->getPHID()])) { | if (isset($filtered[$commit->getPHID()])) { | ||||
| unset($this->identifierMap[$name]); | unset($this->identifierMap[$name]); | ||||
| ▲ Show 20 Lines • Show All 111 Lines • Show Last 20 Lines | |||||
Any reason to prefer this over (commit.importStatus & %d) != 0?