Changeset View
Changeset View
Standalone View
Standalone View
src/applications/repository/storage/PhabricatorRepository.php
| Show First 20 Lines • Show All 997 Lines • ▼ Show 20 Lines | $progress = queryfx_all( | ||||
| 'SELECT importStatus, count(*) N FROM %T WHERE repositoryID = %d | 'SELECT importStatus, count(*) N FROM %T WHERE repositoryID = %d | ||||
| GROUP BY importStatus', | GROUP BY importStatus', | ||||
| id(new PhabricatorRepositoryCommit())->getTableName(), | id(new PhabricatorRepositoryCommit())->getTableName(), | ||||
| $this->getID()); | $this->getID()); | ||||
| $done = 0; | $done = 0; | ||||
| $total = 0; | $total = 0; | ||||
| foreach ($progress as $row) { | foreach ($progress as $row) { | ||||
| $total += $row['N'] * 4; | $total += $row['N'] * 3; | ||||
| $status = $row['importStatus']; | $status = $row['importStatus']; | ||||
| if ($status & PhabricatorRepositoryCommit::IMPORTED_MESSAGE) { | if ($status & PhabricatorRepositoryCommit::IMPORTED_MESSAGE) { | ||||
| $done += $row['N']; | $done += $row['N']; | ||||
| } | } | ||||
| if ($status & PhabricatorRepositoryCommit::IMPORTED_CHANGE) { | if ($status & PhabricatorRepositoryCommit::IMPORTED_CHANGE) { | ||||
| $done += $row['N']; | $done += $row['N']; | ||||
| } | } | ||||
| if ($status & PhabricatorRepositoryCommit::IMPORTED_OWNERS) { | if ($status & PhabricatorRepositoryCommit::IMPORTED_PUBLISH) { | ||||
| $done += $row['N']; | |||||
| } | |||||
| if ($status & PhabricatorRepositoryCommit::IMPORTED_HERALD) { | |||||
| $done += $row['N']; | $done += $row['N']; | ||||
| } | } | ||||
| } | } | ||||
| if ($total) { | if ($total) { | ||||
| $ratio = ($done / $total); | $ratio = ($done / $total); | ||||
| } else { | } else { | ||||
| $ratio = 0; | $ratio = 0; | ||||
| ▲ Show 20 Lines • Show All 1,731 Lines • Show Last 20 Lines | |||||