Changeset View
Changeset View
Standalone View
Standalone View
src/parser/ArcanistBaseCommitParser.php
| Show First 20 Lines • Show All 115 Lines • ▼ Show 20 Lines | final class ArcanistBaseCommitParser { | ||||
| * Handle resolving "arc:*" rules. | * Handle resolving "arc:*" rules. | ||||
| */ | */ | ||||
| private function resolveArcRule($rule, $name, $source) { | private function resolveArcRule($rule, $name, $source) { | ||||
| $name = $this->updateLegacyRuleName($name); | $name = $this->updateLegacyRuleName($name); | ||||
| switch ($name) { | switch ($name) { | ||||
| case 'verbose': | case 'verbose': | ||||
| $this->verbose = true; | $this->verbose = true; | ||||
| $this->log("Enabled verbose mode."); | $this->log('Enabled verbose mode.'); | ||||
| break; | break; | ||||
| case 'prompt': | case 'prompt': | ||||
| $reason = "it is what you typed when prompted."; | $reason = 'it is what you typed when prompted.'; | ||||
| $this->api->setBaseCommitExplanation($reason); | $this->api->setBaseCommitExplanation($reason); | ||||
| return phutil_console_prompt('Against which commit?'); | return phutil_console_prompt('Against which commit?'); | ||||
| case 'local': | case 'local': | ||||
| case 'user': | case 'user': | ||||
| case 'project': | case 'project': | ||||
| case 'runtime': | case 'runtime': | ||||
| case 'system': | case 'system': | ||||
| // Push the other source on top of the list. | // Push the other source on top of the list. | ||||
| array_unshift($this->try, $name); | array_unshift($this->try, $name); | ||||
| $this->log("Switching to source '{$name}'."); | $this->log("Switching to source '{$name}'."); | ||||
| return false; | return false; | ||||
| case 'yield': | case 'yield': | ||||
| // Cycle this source to the end of the list. | // Cycle this source to the end of the list. | ||||
| $this->try[] = array_shift($this->try); | $this->try[] = array_shift($this->try); | ||||
| $this->log("Yielding processing of rules from '{$source}'."); | $this->log("Yielding processing of rules from '{$source}'."); | ||||
| return false; | return false; | ||||
| case 'halt': | case 'halt': | ||||
| // Dump the whole stack. | // Dump the whole stack. | ||||
| $this->try = array(); | $this->try = array(); | ||||
| $this->log("Halting all rule processing."); | $this->log('Halting all rule processing.'); | ||||
| return false; | return false; | ||||
| case 'skip': | case 'skip': | ||||
| return null; | return null; | ||||
| case 'empty': | case 'empty': | ||||
| case 'upstream': | case 'upstream': | ||||
| case 'outgoing': | case 'outgoing': | ||||
| case 'bookmark': | case 'bookmark': | ||||
| case 'amended': | case 'amended': | ||||
| Show All 38 Lines | |||||