1
0
Fork 0

Minor tweaks refs #4878

pull/4431/merge
Jordi Boggiano 2016-02-13 17:43:57 +00:00
parent e4ede0c582
commit d347e1efca
6 changed files with 15 additions and 25 deletions

View File

@ -252,14 +252,19 @@ class DownloadManager
$target->setInstallationSource($installationSource);
try {
$downloader->update($initial, $target, $targetDir);
return;
} catch (\RuntimeException $ex) {
if (!$this->io->isInteractive() ||
!$this->io->askConfirmation(' Updating failed. Would you like to try reinstalling instead [<comment>yes</comment>]? ', true)) {
throw $ex;
} catch (\RuntimeException $e) {
if (!$this->io->isInteractive()) {
throw $e;
}
$this->io->writeError('<error> Update failed ('.$e->getMessage().')');
if (!$this->io->askConfirmation(' Would you like to try reinstalling the package instead [<comment>yes</comment>]? ', true)) {
throw $e;
}
}
}
$downloader->remove($initial, $targetDir);
$this->download($target, $targetDir, 'source' === $installationSource);
}

View File

@ -372,15 +372,12 @@ class GitDownloader extends VcsDownloader
}
/**
* Checks if VCS metadata repository has been initialized
* repository example: .git|.svn|.hg
*
* @param string $path
* @return bool
* {@inheritDoc}
*/
protected function hasMetadataRepository($path)
{
$path = $this->normalizePath($path);
return is_dir($path.'/.git');
}
}

View File

@ -86,11 +86,7 @@ class HgDownloader extends VcsDownloader
}
/**
* Checks if VCS metadata repository has been initialized
* repository example: .git|.svn|.hg
*
* @param string $path
* @return bool
* {@inheritDoc}
*/
protected function hasMetadataRepository($path)
{

View File

@ -106,11 +106,7 @@ class PerforceDownloader extends VcsDownloader
}
/**
* Checks if VCS metadata repository has been initialized
* repository example: .git|.svn|.hg
*
* @param string $path
* @return bool
* {@inheritDoc}
*/
protected function hasMetadataRepository($path)
{

View File

@ -190,11 +190,7 @@ class SvnDownloader extends VcsDownloader
}
/**
* Checks if VCS metadata repository has been initialized
* repository example: .git|.svn|.hg
*
* @param string $path
* @return bool
* {@inheritDoc}
*/
protected function hasMetadataRepository($path)
{

View File

@ -133,7 +133,7 @@ abstract class VcsDownloader implements DownloaderInterface, ChangeReportInterfa
// print the commit logs if in verbose mode and VCS metadata is present
// because in case of missing metadata code would trigger another exception
if ($this->io->isVerbose() && $this->hasMetadataRepository($path)) {
if (!$exception && $this->io->isVerbose() && $this->hasMetadataRepository($path)) {
$message = 'Pulling in changes:';
$logs = $this->getCommitLogs($initial->getSourceReference(), $target->getSourceReference(), $path);