Changeset View
Changeset View
Standalone View
Standalone View
src/applications/config/check/PhabricatorBinariesSetupCheck.php
Show First 20 Lines • Show All 93 Lines • ▼ Show 20 Lines | foreach ($vcses as $vcs) { | ||||
if (!Filesystem::binaryExists($binary)) { | if (!Filesystem::binaryExists($binary)) { | ||||
$message = pht( | $message = pht( | ||||
'You have at least one repository configured which uses this '. | 'You have at least one repository configured which uses this '. | ||||
'version control system. It will not work without the VCS binary.'); | 'version control system. It will not work without the VCS binary.'); | ||||
$this->raiseWarning($binary, $message); | $this->raiseWarning($binary, $message); | ||||
continue; | continue; | ||||
} | } | ||||
$version = null; | $version = PhutilBinaryAnalyzer::getForBinary($binary) | ||||
->getBinaryVersion(); | |||||
switch ($vcs['versionControlSystem']) { | switch ($vcs['versionControlSystem']) { | ||||
case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT: | case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT: | ||||
$bad_versions = array(); | $bad_versions = array(); | ||||
list($err, $stdout, $stderr) = exec_manual('git --version'); | |||||
$version = trim(substr($stdout, strlen('git version '))); | |||||
break; | break; | ||||
case PhabricatorRepositoryType::REPOSITORY_TYPE_SVN: | case PhabricatorRepositoryType::REPOSITORY_TYPE_SVN: | ||||
$bad_versions = array( | $bad_versions = array( | ||||
// We need 1.5 for "--depth", see T7228. | // We need 1.5 for "--depth", see T7228. | ||||
'< 1.5' => pht( | '< 1.5' => pht( | ||||
'The minimum supported version of Subversion is 1.5, which '. | 'The minimum supported version of Subversion is 1.5, which '. | ||||
'was released in 2008.'), | 'was released in 2008.'), | ||||
'= 1.7.1' => pht( | '= 1.7.1' => pht( | ||||
'This version of Subversion has a bug where `%s` does not work '. | 'This version of Subversion has a bug where `%s` does not work '. | ||||
'for files added in rN (Subversion issue #2873), fixed in 1.7.2.', | 'for files added in rN (Subversion issue #2873), fixed in 1.7.2.', | ||||
'svn diff -c N'), | 'svn diff -c N'), | ||||
); | ); | ||||
list($err, $stdout, $stderr) = exec_manual('svn --version --quiet'); | |||||
$version = trim($stdout); | |||||
break; | break; | ||||
case PhabricatorRepositoryType::REPOSITORY_TYPE_MERCURIAL: | case PhabricatorRepositoryType::REPOSITORY_TYPE_MERCURIAL: | ||||
$bad_versions = array( | $bad_versions = array( | ||||
// We need 1.9 for HTTP cloning, see T3046. | // We need 1.9 for HTTP cloning, see T3046. | ||||
'< 1.9' => pht( | '< 1.9' => pht( | ||||
'The minimum supported version of Mercurial is 1.9, which was '. | 'The minimum supported version of Mercurial is 1.9, which was '. | ||||
'released in 2011.'), | 'released in 2011.'), | ||||
'= 2.1' => pht( | '= 2.1' => pht( | ||||
'This version of Mercurial returns a bad exit code '. | 'This version of Mercurial returns a bad exit code '. | ||||
'after a successful pull.'), | 'after a successful pull.'), | ||||
'= 2.2' => pht( | '= 2.2' => pht( | ||||
'This version of Mercurial has a significant memory leak, fixed '. | 'This version of Mercurial has a significant memory leak, fixed '. | ||||
'in 2.2.1. Pushing fails with this version as well; see %s.', | 'in 2.2.1. Pushing fails with this version as well; see %s.', | ||||
'T3046#54922'), | 'T3046#54922'), | ||||
); | ); | ||||
$version = PhabricatorRepositoryVersion::getMercurialVersion(); | |||||
break; | break; | ||||
} | } | ||||
if ($version === null) { | if ($version === null) { | ||||
$this->raiseUnknownVersionWarning($binary); | $this->raiseUnknownVersionWarning($binary); | ||||
} else { | } else { | ||||
$version_details = array(); | $version_details = array(); | ||||
▲ Show 20 Lines • Show All 121 Lines • Show Last 20 Lines |