parent
5460e5d86f
commit
c9aa9c0d2f
|
@ -107,9 +107,7 @@ class Svn
|
||||||
// Ensure we are allowed to use this URL by config
|
// Ensure we are allowed to use this URL by config
|
||||||
$this->config->prohibitUrlByConfig($url, $this->io);
|
$this->config->prohibitUrlByConfig($url, $this->io);
|
||||||
|
|
||||||
$svnCommand = $this->getCommand($command, $url, $path);
|
return $this->executeWithAuthRetry($command, $cwd, $url, $path, $verbose);
|
||||||
|
|
||||||
return $this->executeWithAuthRetry($svnCommand, $cwd, $path, $verbose);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -126,18 +124,15 @@ class Svn
|
||||||
*/
|
*/
|
||||||
public function executeLocal($command, $path, $cwd = null, $verbose = false)
|
public function executeLocal($command, $path, $cwd = null, $verbose = false)
|
||||||
{
|
{
|
||||||
$svnCommand = sprintf('%s %s%s %s',
|
// A local command has no remote url
|
||||||
$command,
|
return $this->executeWithAuthRetry($command, $cwd, '', $path, $verbose);
|
||||||
'--non-interactive ',
|
|
||||||
$this->getCredentialString(),
|
|
||||||
ProcessExecutor::escape($path)
|
|
||||||
);
|
|
||||||
|
|
||||||
return $this->executeWithAuthRetry($svnCommand, $cwd, $path, $verbose);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function executeWithAuthRetry($command, $cwd, $path, $verbose)
|
private function executeWithAuthRetry($svnCommand, $cwd, $url, $path, $verbose)
|
||||||
{
|
{
|
||||||
|
// Regenerate the command at each try, to use the newly user-provided credentials
|
||||||
|
$command = $this->getCommand($svnCommand, $url, $path);
|
||||||
|
|
||||||
$output = null;
|
$output = null;
|
||||||
$io = $this->io;
|
$io = $this->io;
|
||||||
$handler = function ($type, $buffer) use (&$output, $io, $verbose) {
|
$handler = function ($type, $buffer) use (&$output, $io, $verbose) {
|
||||||
|
@ -175,7 +170,7 @@ class Svn
|
||||||
// try to authenticate if maximum quantity of tries not reached
|
// try to authenticate if maximum quantity of tries not reached
|
||||||
if ($this->qtyAuthTries++ < self::MAX_QTY_AUTH_TRIES) {
|
if ($this->qtyAuthTries++ < self::MAX_QTY_AUTH_TRIES) {
|
||||||
// restart the process
|
// restart the process
|
||||||
return $this->executeWithAuthRetry($command, $cwd, $path, $verbose);
|
return $this->executeWithAuthRetry($svnCommand, $cwd, $url, $path, $verbose);
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new \RuntimeException(
|
throw new \RuntimeException(
|
||||||
|
|
Loading…
Reference in New Issue