Changeset View
Changeset View
Standalone View
Standalone View
src/applications/repository/storage/PhabricatorRepository.php
| Show First 20 Lines • Show All 1,157 Lines • ▼ Show 20 Lines | $this->openTransaction(); | ||||
| ->loadAllWhere('repositoryPHID = %s', $this->getPHID()); | ->loadAllWhere('repositoryPHID = %s', $this->getPHID()); | ||||
| foreach ($paths as $path) { | foreach ($paths as $path) { | ||||
| $path->delete(); | $path->delete(); | ||||
| } | } | ||||
| $projects = id(new PhabricatorRepositoryArcanistProject()) | $projects = id(new PhabricatorRepositoryArcanistProject()) | ||||
| ->loadAllWhere('repositoryID = %d', $this->getID()); | ->loadAllWhere('repositoryID = %d', $this->getID()); | ||||
| foreach ($projects as $project) { | foreach ($projects as $project) { | ||||
| // note each project deletes its PhabricatorRepositorySymbols | |||||
| $project->delete(); | $project->delete(); | ||||
| } | } | ||||
| queryfx( | |||||
| $this->establishConnection('w'), | |||||
| 'DELETE FROM %T WHERE repositoryPHID = %s', | |||||
| id(new PhabricatorRepositorySymbol())->getTableName(), | |||||
| $this->getPHID()); | |||||
| $commits = id(new PhabricatorRepositoryCommit()) | $commits = id(new PhabricatorRepositoryCommit()) | ||||
| ->loadAllWhere('repositoryID = %d', $this->getID()); | ->loadAllWhere('repositoryID = %d', $this->getID()); | ||||
| foreach ($commits as $commit) { | foreach ($commits as $commit) { | ||||
| // note PhabricatorRepositoryAuditRequests and | // note PhabricatorRepositoryAuditRequests and | ||||
| // PhabricatorRepositoryCommitData are deleted here too. | // PhabricatorRepositoryCommitData are deleted here too. | ||||
| $commit->delete(); | $commit->delete(); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 698 Lines • Show Last 20 Lines | |||||