mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-10 23:01:04 +01:00
Detect missing 'svn', 'hg' and 'git' during setup
Summary: These are a bit tricky because we don't want to require you to install a VCS you don't use just to use Phabricator. Test that repositories exist before performing the checks. I'll couple this with additional checks during repository creation. Test Plan: Changed binary names to nonexistent ones, verified setup issues raised properly. Reviewers: btrahan Reviewed By: btrahan CC: aran Differential Revision: https://secure.phabricator.com/D6040
This commit is contained in:
parent
9c925464ba
commit
6551ea8245
1 changed files with 34 additions and 0 deletions
|
@ -60,6 +60,40 @@ final class PhabricatorSetupCheckBinaries extends PhabricatorSetupCheck {
|
||||||
"differing files, but did not."));
|
"differing files, but did not."));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$table = new PhabricatorRepository();
|
||||||
|
$vcses = queryfx_all(
|
||||||
|
$table->establishConnection('r'),
|
||||||
|
'SELECT DISTINCT versionControlSystem FROM %T',
|
||||||
|
$table->getTableName());
|
||||||
|
|
||||||
|
foreach ($vcses as $vcs) {
|
||||||
|
switch ($vcs['versionControlSystem']) {
|
||||||
|
case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT:
|
||||||
|
$binary = 'git';
|
||||||
|
break;
|
||||||
|
case PhabricatorRepositoryType::REPOSITORY_TYPE_SVN:
|
||||||
|
$binary = 'svn';
|
||||||
|
break;
|
||||||
|
case PhabricatorRepositoryType::REPOSITORY_TYPE_MERCURIAL:
|
||||||
|
$binary = 'hg';
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$binary = null;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (!$binary) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!Filesystem::binaryExists($binary)) {
|
||||||
|
$message = pht(
|
||||||
|
'You have at least one repository configured which uses this '.
|
||||||
|
'version control system. It will not work without the VCS binary.');
|
||||||
|
$this->raiseWarning($binary, $message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function raiseWarning($bin, $message) {
|
private function raiseWarning($bin, $message) {
|
||||||
|
|
Loading…
Reference in a new issue