Differential D19831 Diff 47391 src/applications/drydock/blueprint/DrydockWorkingCopyBlueprintImplementation.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/drydock/blueprint/DrydockWorkingCopyBlueprintImplementation.php
Show First 20 Lines • Show All 181 Lines • ▼ Show 20 Lines | foreach ($map as $directory => $spec) { | ||||
$repository = $repositories[$spec['phid']]; | $repository = $repositories[$spec['phid']]; | ||||
$path = "{$root}/repo/{$directory}/"; | $path = "{$root}/repo/{$directory}/"; | ||||
$future = $interface->getExecFuture( | $future = $interface->getExecFuture( | ||||
'git clone -- %s %s', | 'git clone -- %s %s', | ||||
(string)$repository->getCloneURIObject(), | (string)$repository->getCloneURIObject(), | ||||
$path); | $path); | ||||
$future->setTimeout($repository->getCopyTimeLimit()); | $future->setTimeout($repository->getEffectiveCopyTimeLimit()); | ||||
$futures[$directory] = $future; | $futures[$directory] = $future; | ||||
} | } | ||||
foreach (new FutureIterator($futures) as $key => $future) { | foreach (new FutureIterator($futures) as $key => $future) { | ||||
$future->resolvex(); | $future->resolvex(); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 80 Lines • ▼ Show 20 Lines | foreach ($map as $directory => $spec) { | ||||
$cmd[] = 'git checkout %s --'; | $cmd[] = 'git checkout %s --'; | ||||
$arg[] = $branch; | $arg[] = $branch; | ||||
$cmd[] = 'git reset --hard origin/%s'; | $cmd[] = 'git reset --hard origin/%s'; | ||||
$arg[] = $branch; | $arg[] = $branch; | ||||
} | } | ||||
$this->newExecvFuture($interface, $cmd, $arg) | $this->newExecvFuture($interface, $cmd, $arg) | ||||
->setTimeout($repository->getCopyTimeLimit()) | ->setTimeout($repository->getEffectiveCopyTimeLimit()) | ||||
->resolvex(); | ->resolvex(); | ||||
if (idx($spec, 'default')) { | if (idx($spec, 'default')) { | ||||
$default = $directory; | $default = $directory; | ||||
} | } | ||||
// If we're fetching a ref from a remote, do that separately so we can | // If we're fetching a ref from a remote, do that separately so we can | ||||
// raise a more tailored error. | // raise a more tailored error. | ||||
Show All 9 Lines | foreach ($map as $directory => $spec) { | ||||
$arg[] = $ref_ref; | $arg[] = $ref_ref; | ||||
$arg[] = $ref_ref; | $arg[] = $ref_ref; | ||||
$cmd[] = 'git checkout %s --'; | $cmd[] = 'git checkout %s --'; | ||||
$arg[] = $ref_ref; | $arg[] = $ref_ref; | ||||
try { | try { | ||||
$this->newExecvFuture($interface, $cmd, $arg) | $this->newExecvFuture($interface, $cmd, $arg) | ||||
->setTimeout($repository->getCopyTimeLimit()) | ->setTimeout($repository->getEffectiveCopyTimeLimit()) | ||||
->resolvex(); | ->resolvex(); | ||||
} catch (CommandException $ex) { | } catch (CommandException $ex) { | ||||
$display_command = csprintf( | $display_command = csprintf( | ||||
'git fetch %R %R', | 'git fetch %R %R', | ||||
$ref_uri, | $ref_uri, | ||||
$ref_ref); | $ref_ref); | ||||
$error = DrydockCommandError::newFromCommandException($ex) | $error = DrydockCommandError::newFromCommandException($ex) | ||||
▲ Show 20 Lines • Show All 221 Lines • Show Last 20 Lines |