Changeset View
Changeset View
Standalone View
Standalone View
src/workflow/ArcanistLandWorkflow.php
Show All 26 Lines | |||||
used. You can specify multiple __ref__ arguments to publish multiple changes at | used. You can specify multiple __ref__ arguments to publish multiple changes at | ||||
once. | once. | ||||
A __ref__ can be any symbol which identifies a commit: a branch name, a tag | A __ref__ can be any symbol which identifies a commit: a branch name, a tag | ||||
name, a bookmark name, a topic name, a raw commit hash, a symbolic reference, | name, a bookmark name, a topic name, a raw commit hash, a symbolic reference, | ||||
etc. | etc. | ||||
When you provide a __ref__, all unpublished changes which are present in | When you provide a __ref__, all unpublished changes which are present in | ||||
ancestors of that __ref__ will be selected for publishing. | ancestors of that __ref__ will be selected for publishing. (With the | ||||
**--pick** flag, only the unpublished changes you directly reference will be | |||||
selected.) | |||||
For example, if you provide local branch "feature3" as a __ref__ argument, that | For example, if you provide local branch "feature3" as a __ref__ argument, that | ||||
may also select the changes in "feature1" and "feature2" (if they are ancestors | may also select the changes in "feature1" and "feature2" (if they are ancestors | ||||
of "feature3"). If you stack changes in a single local branch, all commits in | of "feature3"). If you stack changes in a single local branch, all commits in | ||||
the stack may be selected. | the stack may be selected. | ||||
The workflow merges unpublished changes reachable from __ref__ "into" some | The workflow merges unpublished changes reachable from __ref__ "into" some | ||||
intermediate branch, then pushes the combined state "onto" some destination | intermediate branch, then pushes the combined state "onto" some destination | ||||
▲ Show 20 Lines • Show All 173 Lines • ▼ Show 20 Lines | return array( | ||||
'after each merge completes instead of waiting until all '. | 'after each merge completes instead of waiting until all '. | ||||
'merges are completed to push.'), | 'merges are completed to push.'), | ||||
pht( | pht( | ||||
'This is slower than the default behavior and not atomic, '. | 'This is slower than the default behavior and not atomic, '. | ||||
'but may make it easier to resolve conflicts and land '. | 'but may make it easier to resolve conflicts and land '. | ||||
'complicated changes by allowing you to make progress one '. | 'complicated changes by allowing you to make progress one '. | ||||
'step at a time.'), | 'step at a time.'), | ||||
)), | )), | ||||
$this->newWorkflowArgument('pick') | |||||
->setHelp( | |||||
pht( | |||||
'Land only the changes directly named by arguments, instead '. | |||||
'of all reachable ancestors.')), | |||||
$this->newWorkflowArgument('ref') | $this->newWorkflowArgument('ref') | ||||
->setWildcard(true), | ->setWildcard(true), | ||||
); | ); | ||||
} | } | ||||
protected function newPrompts() { | protected function newPrompts() { | ||||
return array( | return array( | ||||
$this->newPrompt('arc.land.large-working-set') | $this->newPrompt('arc.land.large-working-set') | ||||
▲ Show 20 Lines • Show All 70 Lines • ▼ Show 20 Lines | public function runWorkflow() { | ||||
$into = $this->getArgument('into'); | $into = $this->getArgument('into'); | ||||
$is_preview = $this->getArgument('preview'); | $is_preview = $this->getArgument('preview'); | ||||
$should_hold = $this->getArgument('hold'); | $should_hold = $this->getArgument('hold'); | ||||
$should_keep = $this->getArgument('keep-branches'); | $should_keep = $this->getArgument('keep-branches'); | ||||
$revision = $this->getArgument('revision'); | $revision = $this->getArgument('revision'); | ||||
$strategy = $this->getArgument('strategy'); | $strategy = $this->getArgument('strategy'); | ||||
$pick = $this->getArgument('pick'); | |||||
$land_engine | $land_engine | ||||
->setViewer($this->getViewer()) | ->setViewer($this->getViewer()) | ||||
->setWorkflow($this) | ->setWorkflow($this) | ||||
->setLogEngine($this->getLogEngine()) | ->setLogEngine($this->getLogEngine()) | ||||
->setSourceRefs($source_refs) | ->setSourceRefs($source_refs) | ||||
->setShouldHold($should_hold) | ->setShouldHold($should_hold) | ||||
->setShouldKeep($should_keep) | ->setShouldKeep($should_keep) | ||||
->setStrategyArgument($strategy) | ->setStrategyArgument($strategy) | ||||
->setShouldPreview($is_preview) | ->setShouldPreview($is_preview) | ||||
->setOntoRemoteArgument($onto_remote_arg) | ->setOntoRemoteArgument($onto_remote_arg) | ||||
->setOntoArguments($onto_args) | ->setOntoArguments($onto_args) | ||||
->setIntoRemoteArgument($into_remote) | ->setIntoRemoteArgument($into_remote) | ||||
->setIntoEmptyArgument($into_empty) | ->setIntoEmptyArgument($into_empty) | ||||
->setIntoLocalArgument($into_local) | ->setIntoLocalArgument($into_local) | ||||
->setIntoArgument($into) | ->setIntoArgument($into) | ||||
->setPickArgument($pick) | |||||
->setIsIncremental($is_incremental) | ->setIsIncremental($is_incremental) | ||||
->setRevisionSymbol($revision); | ->setRevisionSymbol($revision); | ||||
$land_engine->execute(); | $land_engine->execute(); | ||||
} | } | ||||
} | } |