Update perforce code

main
Jordi Boggiano 11 years ago
parent 31b787249c
commit 97873a27af

@ -26,13 +26,13 @@ class PerforceDownloader extends VcsDownloader
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
public function doDownload(PackageInterface $package, $path) public function doDownload(PackageInterface $package, $path, $url)
{ {
$ref = $package->getSourceReference(); $ref = $package->getSourceReference();
$label = $this->getLabelFromSourceReference($ref); $label = $this->getLabelFromSourceReference($ref);
$this->io->write(' Cloning ' . $ref); $this->io->write(' Cloning ' . $ref);
$this->initPerforce($package, $path); $this->initPerforce($package, $path, $url);
$this->perforce->setStream($ref); $this->perforce->setStream($ref);
$this->perforce->p4Login($this->io); $this->perforce->p4Login($this->io);
$this->perforce->writeP4ClientSpec(); $this->perforce->writeP4ClientSpec();
@ -51,7 +51,7 @@ class PerforceDownloader extends VcsDownloader
return null; return null;
} }
public function initPerforce($package, $path) public function initPerforce($package, $path, $url)
{ {
if (!empty($this->perforce)) { if (!empty($this->perforce)) {
$this->perforce->initializePath($path); $this->perforce->initializePath($path);
@ -63,7 +63,7 @@ class PerforceDownloader extends VcsDownloader
if ($repository instanceof VcsRepository) { if ($repository instanceof VcsRepository) {
$repoConfig = $this->getRepoConfig($repository); $repoConfig = $this->getRepoConfig($repository);
} }
$this->perforce = Perforce::create($repoConfig, $package->getSourceUrl(), $path, $this->process, $this->io); $this->perforce = Perforce::create($repoConfig, $url, $path, $this->process, $this->io);
} }
private function getRepoConfig(VcsRepository $repository) private function getRepoConfig(VcsRepository $repository)
@ -74,9 +74,9 @@ class PerforceDownloader extends VcsDownloader
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
public function doUpdate(PackageInterface $initial, PackageInterface $target, $path) public function doUpdate(PackageInterface $initial, PackageInterface $target, $path, $url)
{ {
$this->doDownload($target, $path); $this->doDownload($target, $path, $url);
} }
/** /**

@ -129,7 +129,7 @@ class PerforceDownloaderTest extends \PHPUnit_Framework_TestCase
$perforce->expects($this->at(5))->method('syncCodeBase')->with($label); $perforce->expects($this->at(5))->method('syncCodeBase')->with($label);
$perforce->expects($this->at(6))->method('cleanupClientSpec'); $perforce->expects($this->at(6))->method('cleanupClientSpec');
$this->downloader->setPerforce($perforce); $this->downloader->setPerforce($perforce);
$this->downloader->doDownload($this->package, $this->testPath); $this->downloader->doDownload($this->package, $this->testPath, 'url');
} }
/** /**
@ -152,7 +152,6 @@ class PerforceDownloaderTest extends \PHPUnit_Framework_TestCase
$perforce->expects($this->at(5))->method('syncCodeBase')->with($label); $perforce->expects($this->at(5))->method('syncCodeBase')->with($label);
$perforce->expects($this->at(6))->method('cleanupClientSpec'); $perforce->expects($this->at(6))->method('cleanupClientSpec');
$this->downloader->setPerforce($perforce); $this->downloader->setPerforce($perforce);
$this->downloader->doDownload($this->package, $this->testPath); $this->downloader->doDownload($this->package, $this->testPath, 'url');
} }
} }

Loading…
Cancel
Save