diff --git a/src/Composer/Downloader/PerforceDownloader.php b/src/Composer/Downloader/PerforceDownloader.php index ad94d1ad8..6ddea153f 100644 --- a/src/Composer/Downloader/PerforceDownloader.php +++ b/src/Composer/Downloader/PerforceDownloader.php @@ -36,7 +36,7 @@ class PerforceDownloader extends VcsDownloader $this->io->write(' Cloning ' . $ref); $this->initPerforce($package, $path, $ref); $this->perforce->setStream($ref); - $this->perforce->queryP4User($this->io); + $this->perforce->p4Login($this->io); $this->perforce->writeP4ClientSpec(); $this->perforce->connectClient(); $this->perforce->syncCodeBase($label); diff --git a/src/Composer/Util/Perforce.php b/src/Composer/Util/Perforce.php index 7ac147b49..2fb0e4bea 100644 --- a/src/Composer/Util/Perforce.php +++ b/src/Composer/Util/Perforce.php @@ -282,15 +282,13 @@ class Perforce $prevDir = getcwd(); chdir($this->path); - $this->executeCommand('pwd'); - $p4SyncCommand = $this->generateP4Command('sync -f '); if (isset($label)) { if (strcmp($label, 'dev-master') != 0) { $p4SyncCommand = $p4SyncCommand . '@' . $label; } } - $this->executeCommand($p4SyncCommand); + $result = $this->executeCommand($p4SyncCommand); chdir($prevDir); } @@ -313,11 +311,7 @@ class Perforce } else { fwrite( $spec, - 'View: ' . $this->getStream() . '/... //' . $this->getClient() . '/' . str_replace( - '//', - '', - $this->getStream() - ) . '/... ' . PHP_EOL + 'View: ' . $this->getStream() . '/... //' . $this->getClient() . '/... ' . PHP_EOL ); } } diff --git a/tests/Composer/Test/Util/PerforceTest.php b/tests/Composer/Test/Util/PerforceTest.php index 73b06bc6e..6bde3d797 100644 --- a/tests/Composer/Test/Util/PerforceTest.php +++ b/tests/Composer/Test/Util/PerforceTest.php @@ -663,7 +663,7 @@ class PerforceTest extends \PHPUnit_Framework_TestCase $expectedArray[] = 'Stream:'; $expectedArray[] = ' //depot/branch'; } else { - $expectedArray[] = 'View: //depot/... //composer_perforce_TEST_depot/depot/...'; + $expectedArray[] = 'View: //depot/... //composer_perforce_TEST_depot/...'; } return $expectedArray;