1
0
Fork 0

hg repos must not be hosted somewhere in particular, but detection may become expensive.

Additionally, suppress warnings and support file://-local repos
pull/154/head
Matthias Pigulla 2011-12-09 23:10:31 +01:00
parent 381fcb248a
commit 2fc8e06d81
2 changed files with 9 additions and 14 deletions

View File

@ -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;
}
}

View File

@ -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;
}
}