1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-25 16:22:42 +01:00

Modernize output when pruning branches in Git during "arc land"

Summary: Ref T13546. Make this output look more similar to other modern output.

Test Plan: Ran "arc land", saw consistent-looking output.

Maniphest Tasks: T13546

Differential Revision: https://secure.phabricator.com/D21319
This commit is contained in:
epriestley 2020-06-05 13:24:37 -07:00
parent 94f78cf87c
commit 57d0d690cc

View file

@ -17,6 +17,9 @@ final class ArcanistGitLandEngine
} }
protected function pruneBranches(array $sets) { protected function pruneBranches(array $sets) {
$api = $this->getRepositoryAPI();
$log = $this->getLogEngine();
$old_commits = array(); $old_commits = array();
foreach ($sets as $set) { foreach ($sets as $set) {
$hash = last($set->getCommits())->getHash(); $hash = last($set->getCommits())->getHash();
@ -27,20 +30,19 @@ final class ArcanistGitLandEngine
$old_commits, $old_commits,
$is_contains = false); $is_contains = false);
$api = $this->getRepositoryAPI();
foreach ($branch_map as $branch_name => $branch_hash) { foreach ($branch_map as $branch_name => $branch_hash) {
$recovery_command = csprintf( $recovery_command = csprintf(
'git checkout -b %s %s', 'git checkout -b %s %s',
$branch_name, $branch_name,
$this->getDisplayHash($branch_hash)); $this->getDisplayHash($branch_hash));
echo tsprintf( $log->writeStatus(
"%s\n", pht('CLEANUP'),
pht('Cleaning up branch "%s"...', $branch_name)); pht('Destroying branch "%s". To recover, run:', $branch_name));
echo tsprintf( echo tsprintf(
"%s\n", "\n **$** %s\n\n",
pht('(Use `%s` if you want it back.)', $recovery_command)); $recovery_command);
$api->execxLocal('branch -D -- %s', $branch_name); $api->execxLocal('branch -D -- %s', $branch_name);
$this->deletedBranches[$branch_name] = true; $this->deletedBranches[$branch_name] = true;