Changeset View
Changeset View
Standalone View
Standalone View
src/toolset/ArcanistAliasEngine.php
Show First 20 Lines • Show All 166 Lines • ▼ Show 20 Lines | if (!$toolset_matches) { | ||||
->setCommand($command) | ->setCommand($command) | ||||
->setArguments($argv); | ->setArguments($argv); | ||||
} | } | ||||
return $results; | return $results; | ||||
} | } | ||||
$alias = array_pop($toolset_matches); | $alias = array_pop($toolset_matches); | ||||
foreach ($toolset_matches as $ignored_match) { | |||||
if ($toolset_matches) { | |||||
$source = $alias->getConfigurationSource(); | |||||
$results[] = $this->newEffect(ArcanistAliasEffect::EFFECT_IGNORED) | $results[] = $this->newEffect(ArcanistAliasEffect::EFFECT_IGNORED) | ||||
->setMessage( | ->setMessage( | ||||
pht( | pht( | ||||
'Multiple configuration sources define an alias for "%s %s". '. | 'Multiple configuration sources define an alias for "%s %s". '. | ||||
'The definition in "%s" will be ignored.', | 'The last definition in the most specific source ("%s") will '. | ||||
'be used.', | |||||
$toolset_key, | |||||
$command, | |||||
$source->getSourceDisplayName())); | |||||
foreach ($toolset_matches as $ignored_match) { | |||||
$source = $ignored_match->getConfigurationSource(); | |||||
$results[] = $this->newEffect(ArcanistAliasEffect::EFFECT_IGNORED) | |||||
->setMessage( | |||||
pht( | |||||
'A definition of "%s %s" in "%s" will be ignored.', | |||||
$toolset_key, | $toolset_key, | ||||
$command, | $command, | ||||
$ignored_match->getConfigurationSource()->getSourceDisplayName())); | $source->getSourceDisplayName())); | ||||
} | |||||
} | } | ||||
if ($alias->isShellCommandAlias()) { | if ($alias->isShellCommandAlias()) { | ||||
$results[] = $this->newEffect(ArcanistAliasEffect::EFFECT_SHELL) | $results[] = $this->newEffect(ArcanistAliasEffect::EFFECT_SHELL) | ||||
->setMessage( | ->setMessage( | ||||
pht( | pht( | ||||
'%s %s -> $ %s', | '%s %s -> $ %s', | ||||
$toolset_key, | $toolset_key, | ||||
Show All 30 Lines | if (count($stack) >= $stack_limit) { | ||||
->setMessage( | ->setMessage( | ||||
pht( | pht( | ||||
'Alias definitions form an unreasonably deep stack. A chain of '. | 'Alias definitions form an unreasonably deep stack. A chain of '. | ||||
'aliases may not resolve more than %s times.', | 'aliases may not resolve more than %s times.', | ||||
new PhutilNumber($stack_limit))); | new PhutilNumber($stack_limit))); | ||||
return $results; | return $results; | ||||
} | } | ||||
$display_argv = (string)csprintf('%LR', $alias_argv); | |||||
$results[] = $this->newEffect(ArcanistAliasEffect::EFFECT_ALIAS) | $results[] = $this->newEffect(ArcanistAliasEffect::EFFECT_ALIAS) | ||||
->setMessage( | ->setMessage( | ||||
pht( | pht( | ||||
'%s %s -> %s %s', | '%s %s -> %s %s %s', | ||||
$toolset_key, | $toolset_key, | ||||
$command, | $command, | ||||
$toolset_key, | $toolset_key, | ||||
$alias_command)); | $alias_command, | ||||
$display_argv)); | |||||
$argv = array_merge($alias_argv, $argv); | $argv = array_merge($alias_argv, $argv); | ||||
return $this->resolveAliasesForCommand( | return $this->resolveAliasesForCommand( | ||||
$aliases, | $aliases, | ||||
$alias_command, | $alias_command, | ||||
$argv, | $argv, | ||||
$results, | $results, | ||||
Show All 9 Lines |