diff --git a/src/Composer/Repository/Vcs/HgDriver.php b/src/Composer/Repository/Vcs/HgDriver.php index 29af3199b..b51dcaf52 100644 --- a/src/Composer/Repository/Vcs/HgDriver.php +++ b/src/Composer/Repository/Vcs/HgDriver.php @@ -172,16 +172,11 @@ class HgDriver implements VcsDriverInterface */ public static function supports($url, $deep = false) { - if (preg_match('#(^(?:https?|ssh)://(?:[^@]@)?bitbucket.org|https://(?:.*?)\.kilnhg.com)#i', $url)) { - return true; - } + if ($deep) { + exec(sprintf('hg identify %s', escapeshellarg($url)), $outputIgnored, $exit); + return $exit == 0; + } - if (!$deep) { - return false; - } - - exec(sprintf('hg identify %s', escapeshellarg($url)), $output); - - return (boolean)$output; + return false; } } diff --git a/src/Composer/Repository/Vcs/SvnDriver.php b/src/Composer/Repository/Vcs/SvnDriver.php index a1574b6b8..23ec54e81 100644 --- a/src/Composer/Repository/Vcs/SvnDriver.php +++ b/src/Composer/Repository/Vcs/SvnDriver.php @@ -174,11 +174,11 @@ class SvnDriver implements VcsDriverInterface return true; } - if (!$deep) { - return false; + if ($deep) { + @exec(sprintf('svn info --non-interactive %s 2>/dev/null', escapeshellarg($url)), $outputIgnored, $exit); + return $exit == 0; } - exec(sprintf('svn info --non-interactive %s', escapeshellarg($url)), $output); - return preg_match('{^Repository UUID:}m', implode("\n", $output)) >= 1; + return false; } }