diff --git a/src/configuration/ArcanistConfigurationManager.php b/src/configuration/ArcanistConfigurationManager.php index 3473a0bd..0d0a92e7 100644 --- a/src/configuration/ArcanistConfigurationManager.php +++ b/src/configuration/ArcanistConfigurationManager.php @@ -100,7 +100,17 @@ final class ArcanistConfigurationManager extends Phobject { } $user_config = $this->readUserArcConfig(); - $pval = idx($user_config, $key); + + // For "aliases" coming from the user config file specifically, read the + // top level "aliases" key instead of the "aliases" key inside the "config" + // setting. Aliases were originally user-specific but later became standard + // configuration, which is why this works oddly. + if ($key === 'aliases') { + $pval = idx($this->readUserConfigurationFile(), $key); + } else { + $pval = idx($user_config, $key); + } + if ($pval !== null) { $results[self::CONFIG_SOURCE_USER] = $settings->willReadValue($key, $pval); diff --git a/src/workflow/ArcanistAliasWorkflow.php b/src/workflow/ArcanistAliasWorkflow.php index 7fc9dfe7..b27b3ebf 100644 --- a/src/workflow/ArcanistAliasWorkflow.php +++ b/src/workflow/ArcanistAliasWorkflow.php @@ -59,17 +59,14 @@ EOTEXT public static function getAliases( ArcanistConfigurationManager $configuration_manager) { + $sources = $configuration_manager->getConfigFromAllSources('aliases'); - $working_copy_config_aliases = - $configuration_manager->getProjectConfig('aliases'); - if (!$working_copy_config_aliases) { - $working_copy_config_aliases = array(); + $aliases = array(); + foreach ($sources as $source) { + $aliases += $source; } - $user_config_aliases = idx( - $configuration_manager->readUserConfigurationFile(), - 'aliases', - array()); - return $user_config_aliases + $working_copy_config_aliases; + + return $aliases; } private function writeAliases(array $aliases) {