hg repos must not be hosted somewhere in particular, but detection may become expensive.
Additionally, suppress warnings and support file://-local repospull/154/head
parent
381fcb248a
commit
2fc8e06d81
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue