Changeset View
Changeset View
Standalone View
Standalone View
src/land/engine/ArcanistLandEngine.php
Show First 20 Lines • Show All 798 Lines • ▼ Show 20 Lines | final protected function loadRevisionRefs(array $commit_map) { | ||||
assert_instances_of($commit_map, 'ArcanistLandCommit'); | assert_instances_of($commit_map, 'ArcanistLandCommit'); | ||||
$api = $this->getRepositoryAPI(); | $api = $this->getRepositoryAPI(); | ||||
$workflow = $this->getWorkflow(); | $workflow = $this->getWorkflow(); | ||||
$state_refs = array(); | $state_refs = array(); | ||||
foreach ($commit_map as $commit) { | foreach ($commit_map as $commit) { | ||||
$hash = $commit->getHash(); | $hash = $commit->getHash(); | ||||
$commit_ref = id(new ArcanistCommitRef()) | $commit_ref = (new ArcanistCommitRef()) | ||||
->setCommitHash($hash); | ->setCommitHash($hash); | ||||
$state_ref = id(new ArcanistWorkingCopyStateRef()) | $state_ref = (new ArcanistWorkingCopyStateRef()) | ||||
->setCommitRef($commit_ref); | ->setCommitRef($commit_ref); | ||||
$state_refs[$hash] = $state_ref; | $state_refs[$hash] = $state_ref; | ||||
} | } | ||||
$force_symbol_ref = $this->getRevisionSymbolRef(); | $force_symbol_ref = $this->getRevisionSymbolRef(); | ||||
$force_ref = null; | $force_ref = null; | ||||
if ($force_symbol_ref) { | if ($force_symbol_ref) { | ||||
▲ Show 20 Lines • Show All 287 Lines • ▼ Show 20 Lines | public function execute() { | ||||
$raw_symbols = $this->getSourceRefs(); | $raw_symbols = $this->getSourceRefs(); | ||||
if (!$raw_symbols) { | if (!$raw_symbols) { | ||||
$raw_symbols = $this->getDefaultSymbols(); | $raw_symbols = $this->getDefaultSymbols(); | ||||
} | } | ||||
$symbols = array(); | $symbols = array(); | ||||
foreach ($raw_symbols as $raw_symbol) { | foreach ($raw_symbols as $raw_symbol) { | ||||
$symbols[] = id(new ArcanistLandSymbol()) | $symbols[] = (new ArcanistLandSymbol()) | ||||
->setSymbol($raw_symbol); | ->setSymbol($raw_symbol); | ||||
} | } | ||||
$this->resolveSymbols($symbols); | $this->resolveSymbols($symbols); | ||||
$onto_remote = $this->selectOntoRemote($symbols); | $onto_remote = $this->selectOntoRemote($symbols); | ||||
$this->setOntoRemote($onto_remote); | $this->setOntoRemote($onto_remote); | ||||
▲ Show 20 Lines • Show All 55 Lines • ▼ Show 20 Lines | public function execute() { | ||||
$revision_groups = array_select_keys( | $revision_groups = array_select_keys( | ||||
$revision_groups, | $revision_groups, | ||||
array_keys($revision_order)); | array_keys($revision_order)); | ||||
$sets = array(); | $sets = array(); | ||||
foreach ($revision_groups as $revision_phid => $group) { | foreach ($revision_groups as $revision_phid => $group) { | ||||
$revision_ref = head($group)->getRevisionRef(); | $revision_ref = head($group)->getRevisionRef(); | ||||
$set = id(new ArcanistLandCommitSet()) | $set = (new ArcanistLandCommitSet()) | ||||
->setRevisionRef($revision_ref) | ->setRevisionRef($revision_ref) | ||||
->setCommits($group); | ->setCommits($group); | ||||
$sets[$revision_phid] = $set; | $sets[$revision_phid] = $set; | ||||
} | } | ||||
$sets = $this->filterCommitSets($sets); | $sets = $this->filterCommitSets($sets); | ||||
▲ Show 20 Lines • Show All 181 Lines • ▼ Show 20 Lines | if ($is_pick && !$this->isSquashStrategy()) { | ||||
'You can not "--pick" changes under the "merge" strategy.')); | 'You can not "--pick" changes under the "merge" strategy.')); | ||||
} | } | ||||
// Build the symbol ref here (which validates the format of the symbol), | // Build the symbol ref here (which validates the format of the symbol), | ||||
// but don't load the object until later on when we're sure we actually | // but don't load the object until later on when we're sure we actually | ||||
// need it, since loading it requires a relatively expensive Conduit call. | // need it, since loading it requires a relatively expensive Conduit call. | ||||
$revision_symbol = $this->getRevisionSymbol(); | $revision_symbol = $this->getRevisionSymbol(); | ||||
if ($revision_symbol) { | if ($revision_symbol) { | ||||
$symbol_ref = id(new ArcanistRevisionSymbolRef()) | $symbol_ref = (new ArcanistRevisionSymbolRef()) | ||||
->setSymbol($revision_symbol); | ->setSymbol($revision_symbol); | ||||
$this->setRevisionSymbolRef($symbol_ref); | $this->setRevisionSymbolRef($symbol_ref); | ||||
} | } | ||||
// NOTE: When a user provides: "--hold" or "--preview"; and "--incremental" | // NOTE: When a user provides: "--hold" or "--preview"; and "--incremental" | ||||
// or various combinations of remote flags, the flags affecting push/remote | // or various combinations of remote flags, the flags affecting push/remote | ||||
// behavior have no effect. | // behavior have no effect. | ||||
▲ Show 20 Lines • Show All 214 Lines • ▼ Show 20 Lines | final protected function newPassthru($pattern /* , ... */) { | ||||
$command = call_user_func_array( | $command = call_user_func_array( | ||||
array($this, 'newPassthruCommand'), | array($this, 'newPassthruCommand'), | ||||
$argv); | $argv); | ||||
return $command->execute(); | return $command->execute(); | ||||
} | } | ||||
final protected function getOntoRemoteRef() { | final protected function getOntoRemoteRef() { | ||||
return id(new ArcanistRemoteRef()) | return (new ArcanistRemoteRef()) | ||||
->setRemoteName($this->getOntoRemote()); | ->setRemoteName($this->getOntoRemote()); | ||||
} | } | ||||
} | } |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0