mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-12-28 08:20:56 +01:00
Allow "arc upgrade" to work on the "experimental" branch
Summary: Fixes T13459. Currently, the "experimental" branch can not "arc upgrade" itself, but this is a reasonable thing to do; allow it to. Test Plan: Ran "arc upgrade" on "experimental". (This has some bootstrapping issues; will verify after landing.) Maniphest Tasks: T13459 Differential Revision: https://secure.phabricator.com/D20916
This commit is contained in:
parent
2979752639
commit
039144ea24
1 changed files with 13 additions and 8 deletions
|
@ -30,6 +30,13 @@ EOTEXT
|
||||||
'arcanist' => dirname(phutil_get_library_root('arcanist')),
|
'arcanist' => dirname(phutil_get_library_root('arcanist')),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$supported_branches = array(
|
||||||
|
'master',
|
||||||
|
'stable',
|
||||||
|
'experimental',
|
||||||
|
);
|
||||||
|
$supported_branches = array_fuse($supported_branches);
|
||||||
|
|
||||||
foreach ($roots as $lib => $root) {
|
foreach ($roots as $lib => $root) {
|
||||||
echo phutil_console_format(
|
echo phutil_console_format(
|
||||||
"%s\n",
|
"%s\n",
|
||||||
|
@ -76,18 +83,16 @@ EOTEXT
|
||||||
}
|
}
|
||||||
|
|
||||||
$branch_name = $repository->getBranchName();
|
$branch_name = $repository->getBranchName();
|
||||||
if ($branch_name != 'master' && $branch_name != 'stable') {
|
if (!isset($supported_branches[$branch_name])) {
|
||||||
throw new ArcanistUsageException(
|
throw new ArcanistUsageException(
|
||||||
pht(
|
pht(
|
||||||
"%s must be on either branch '%s' or '%s' to be automatically ".
|
'Library "%s" (in "%s") is on branch "%s", but this branch is '.
|
||||||
"upgraded. ".
|
'not supported for automatic upgrades. Supported branches are: '.
|
||||||
"This copy of %s (in '%s') is on branch '%s'.",
|
'%s.',
|
||||||
$lib,
|
|
||||||
'master',
|
|
||||||
'stable',
|
|
||||||
$lib,
|
$lib,
|
||||||
$root,
|
$root,
|
||||||
$branch_name));
|
$branch_name,
|
||||||
|
implode(', ', array_keys($supported_branches))));
|
||||||
}
|
}
|
||||||
|
|
||||||
chdir($root);
|
chdir($root);
|
||||||
|
|
Loading…
Reference in a new issue