Differential D21516 Diff 51210 src/applications/repository/engine/PhabricatorRepositoryRefEngine.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/repository/engine/PhabricatorRepositoryRefEngine.php
| Show First 20 Lines • Show All 542 Lines • ▼ Show 20 Lines | foreach (PhabricatorLiskDAO::chunkSQL($identifier_tokens) as $chunk) { | ||||
| $commit_table->getTableName(), | $commit_table->getTableName(), | ||||
| $repository->getID(), | $repository->getID(), | ||||
| $chunk); | $chunk); | ||||
| foreach ($rows as $row) { | foreach ($rows as $row) { | ||||
| $all_commits[] = $row; | $all_commits[] = $row; | ||||
| } | } | ||||
| } | } | ||||
| $commit_refs = array(); | |||||
| foreach ($identifiers as $identifier) { | |||||
| // See T13591. This construction is a bit ad-hoc, but the priority | |||||
| // function currently only cares about the number of refs we have | |||||
| // discovered, so we'll get the right result even without filling | |||||
| // these records out in detail. | |||||
| $commit_refs[] = id(new PhabricatorRepositoryCommitRef()) | |||||
| ->setIdentifier($identifier); | |||||
| } | |||||
| $task_priority = $this->getImportTaskPriority( | |||||
| $repository, | |||||
| $commit_refs); | |||||
| $permanent_flag = PhabricatorRepositoryCommit::IMPORTED_PERMANENT; | $permanent_flag = PhabricatorRepositoryCommit::IMPORTED_PERMANENT; | ||||
| $published_flag = PhabricatorRepositoryCommit::IMPORTED_PUBLISH; | $published_flag = PhabricatorRepositoryCommit::IMPORTED_PUBLISH; | ||||
| $all_commits = ipull($all_commits, null, 'commitIdentifier'); | $all_commits = ipull($all_commits, null, 'commitIdentifier'); | ||||
| foreach ($identifiers as $identifier) { | foreach ($identifiers as $identifier) { | ||||
| $row = idx($all_commits, $identifier); | $row = idx($all_commits, $identifier); | ||||
| if (!$row) { | if (!$row) { | ||||
| Show All 16 Lines | foreach ($identifiers as $identifier) { | ||||
| queryfx( | queryfx( | ||||
| $conn, | $conn, | ||||
| 'UPDATE %T SET importStatus = %d WHERE id = %d', | 'UPDATE %T SET importStatus = %d WHERE id = %d', | ||||
| $commit_table->getTableName(), | $commit_table->getTableName(), | ||||
| $import_status, | $import_status, | ||||
| $row['id']); | $row['id']); | ||||
| $data = array( | $this->queueCommitImportTask( | ||||
| 'commitID' => $row['id'], | $repository, | ||||
| ); | $row['id'], | ||||
| $row['phid'], | |||||
| PhabricatorWorker::scheduleTask( | $task_priority, | ||||
| $class, | $via = 'ref'); | ||||
| $data, | |||||
| array( | |||||
| 'priority' => PhabricatorWorker::PRIORITY_COMMIT, | |||||
| 'objectPHID' => $row['phid'], | |||||
| )); | |||||
| } | } | ||||
| } | } | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| private function newRefCursor( | private function newRefCursor( | ||||
| PhabricatorRepository $repository, | PhabricatorRepository $repository, | ||||
| ▲ Show 20 Lines • Show All 116 Lines • Show Last 20 Lines | |||||