Changeset View
Changeset View
Standalone View
Standalone View
src/land/engine/ArcanistLandEngine.php
| Show First 20 Lines • Show All 263 Lines • ▼ Show 20 Lines | private function setLocalState(ArcanistRepositoryLocalState $local_state) { | ||||
| $this->localState = $local_state; | $this->localState = $local_state; | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| final protected function getLocalState() { | final protected function getLocalState() { | ||||
| return $this->localState; | return $this->localState; | ||||
| } | } | ||||
| final protected function getOntoConfigurationKey() { | |||||
| return 'arc.land.onto'; | |||||
| } | |||||
| final protected function getOntoFromConfiguration() { | final protected function getOntoFromConfiguration() { | ||||
| $config_key = $this->getOntoConfigurationKey(); | $config_key = $this->getOntoConfigurationKey(); | ||||
| return $this->getWorkflow()->getConfig($config_key); | return $this->getWorkflow()->getConfig($config_key); | ||||
| } | } | ||||
| final protected function getOntoConfigurationKey() { | final protected function getOntoRemoteConfigurationKey() { | ||||
| return 'arc.land.onto'; | return 'arc.land.onto-remote'; | ||||
| } | } | ||||
| final protected function getOntoRemoteFromConfiguration() { | final protected function getOntoRemoteFromConfiguration() { | ||||
| $config_key = $this->getOntoRemoteConfigurationKey(); | $config_key = $this->getOntoRemoteConfigurationKey(); | ||||
| return $this->getWorkflow()->getConfig($config_key); | return $this->getWorkflow()->getConfig($config_key); | ||||
| } | } | ||||
| final protected function getOntoRemoteConfigurationKey() { | final protected function getStrategyConfigurationKey() { | ||||
| return 'arc.land.onto-remote'; | return 'arc.land.strategy'; | ||||
| } | |||||
| final protected function getStrategyFromConfiguration() { | |||||
| $config_key = $this->getStrategyConfigurationKey(); | |||||
| return $this->getWorkflow()->getConfig($config_key); | |||||
| } | } | ||||
| final protected function confirmRevisions(array $sets) { | final protected function confirmRevisions(array $sets) { | ||||
| assert_instances_of($sets, 'ArcanistLandCommitSet'); | assert_instances_of($sets, 'ArcanistLandCommitSet'); | ||||
| $revision_refs = mpull($sets, 'getRevisionRef'); | $revision_refs = mpull($sets, 'getRevisionRef'); | ||||
| $viewer = $this->getViewer(); | $viewer = $this->getViewer(); | ||||
| $viewer_phid = $viewer->getPHID(); | $viewer_phid = $viewer->getPHID(); | ||||
| ▲ Show 20 Lines • Show All 1,156 Lines • ▼ Show 20 Lines | if ($strategy !== null) { | ||||
| pht('STRATEGY'), | pht('STRATEGY'), | ||||
| pht( | pht( | ||||
| 'Merging with "%s" strategy, selected with "--strategy".', | 'Merging with "%s" strategy, selected with "--strategy".', | ||||
| $strategy)); | $strategy)); | ||||
| return $strategy; | return $strategy; | ||||
| } | } | ||||
| $strategy_key = 'arc.land.strategy'; | $strategy = $this->getStrategyFromConfiguration(); | ||||
| $strategy = $this->getWorkflow()->getConfig($strategy_key); | |||||
| if ($strategy !== null) { | if ($strategy !== null) { | ||||
| if (!isset($supported_strategies[$strategy])) { | if (!isset($supported_strategies[$strategy])) { | ||||
| throw new PhutilArgumentUsageException( | throw new PhutilArgumentUsageException( | ||||
| pht( | pht( | ||||
| 'Merge strategy "%s" specified in "%s" configuration is '. | 'Merge strategy "%s" specified in "%s" configuration is '. | ||||
| 'unknown. Supported merge strategies are: %s.', | 'unknown. Supported merge strategies are: %s.', | ||||
| $strategy, | $strategy, | ||||
| $strategy_list)); | $strategy_list)); | ||||
| } | } | ||||
| $log->writeStatus( | $log->writeStatus( | ||||
| pht('STRATEGY'), | pht('STRATEGY'), | ||||
| pht( | pht( | ||||
| 'Merging with "%s" strategy, configured with "%s".', | 'Merging with "%s" strategy, configured with "%s".', | ||||
| $strategy, | $strategy, | ||||
| $strategy_key)); | $this->getStrategyConfigurationKey())); | ||||
| return $strategy; | return $strategy; | ||||
| } | } | ||||
| $strategy = 'squash'; | $strategy = 'squash'; | ||||
| $log->writeStatus( | $log->writeStatus( | ||||
| pht('STRATEGY'), | pht('STRATEGY'), | ||||
| ▲ Show 20 Lines • Show All 82 Lines • Show Last 20 Lines | |||||