Page MenuHomePhabricator

D15342.diff
No OneTemporary

D15342.diff

diff --git a/src/configuration/ArcanistConfigurationManager.php b/src/configuration/ArcanistConfigurationManager.php
--- a/src/configuration/ArcanistConfigurationManager.php
+++ b/src/configuration/ArcanistConfigurationManager.php
@@ -100,7 +100,17 @@
}
$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
--- a/src/workflow/ArcanistAliasWorkflow.php
+++ b/src/workflow/ArcanistAliasWorkflow.php
@@ -59,17 +59,14 @@
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) {

File Metadata

Mime Type
text/plain
Expires
Fri, Nov 22, 8:56 PM (3 h, 30 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6775933
Default Alt Text
D15342.diff (1 KB)

Event Timeline