Fixed issue with non-streaming perforce depots, also fixed issue where PerforceDownloader was not logging in

main
mwhittom 11 years ago
parent 1b68f9151e
commit 8a319a719b

@ -36,7 +36,7 @@ class PerforceDownloader extends VcsDownloader
$this->io->write(' Cloning ' . $ref); $this->io->write(' Cloning ' . $ref);
$this->initPerforce($package, $path, $ref); $this->initPerforce($package, $path, $ref);
$this->perforce->setStream($ref); $this->perforce->setStream($ref);
$this->perforce->queryP4User($this->io); $this->perforce->p4Login($this->io);
$this->perforce->writeP4ClientSpec(); $this->perforce->writeP4ClientSpec();
$this->perforce->connectClient(); $this->perforce->connectClient();
$this->perforce->syncCodeBase($label); $this->perforce->syncCodeBase($label);

@ -282,15 +282,13 @@ class Perforce
$prevDir = getcwd(); $prevDir = getcwd();
chdir($this->path); chdir($this->path);
$this->executeCommand('pwd');
$p4SyncCommand = $this->generateP4Command('sync -f '); $p4SyncCommand = $this->generateP4Command('sync -f ');
if (isset($label)) { if (isset($label)) {
if (strcmp($label, 'dev-master') != 0) { if (strcmp($label, 'dev-master') != 0) {
$p4SyncCommand = $p4SyncCommand . '@' . $label; $p4SyncCommand = $p4SyncCommand . '@' . $label;
} }
} }
$this->executeCommand($p4SyncCommand); $result = $this->executeCommand($p4SyncCommand);
chdir($prevDir); chdir($prevDir);
} }
@ -313,11 +311,7 @@ class Perforce
} else { } else {
fwrite( fwrite(
$spec, $spec,
'View: ' . $this->getStream() . '/... //' . $this->getClient() . '/' . str_replace( 'View: ' . $this->getStream() . '/... //' . $this->getClient() . '/... ' . PHP_EOL
'//',
'',
$this->getStream()
) . '/... ' . PHP_EOL
); );
} }
} }

@ -663,7 +663,7 @@ class PerforceTest extends \PHPUnit_Framework_TestCase
$expectedArray[] = 'Stream:'; $expectedArray[] = 'Stream:';
$expectedArray[] = ' //depot/branch'; $expectedArray[] = ' //depot/branch';
} else { } else {
$expectedArray[] = 'View: //depot/... //composer_perforce_TEST_depot/depot/...'; $expectedArray[] = 'View: //depot/... //composer_perforce_TEST_depot/...';
} }
return $expectedArray; return $expectedArray;

Loading…
Cancel
Save