From 57d0d690cc76de7bb04dc9614a7ec9f84cbf15f5 Mon Sep 17 00:00:00 2001 From: epriestley Date: Fri, 5 Jun 2020 13:24:37 -0700 Subject: [PATCH] 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 --- src/land/engine/ArcanistGitLandEngine.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/land/engine/ArcanistGitLandEngine.php b/src/land/engine/ArcanistGitLandEngine.php index 76cf4771..21915ad4 100644 --- a/src/land/engine/ArcanistGitLandEngine.php +++ b/src/land/engine/ArcanistGitLandEngine.php @@ -17,6 +17,9 @@ final class ArcanistGitLandEngine } protected function pruneBranches(array $sets) { + $api = $this->getRepositoryAPI(); + $log = $this->getLogEngine(); + $old_commits = array(); foreach ($sets as $set) { $hash = last($set->getCommits())->getHash(); @@ -27,20 +30,19 @@ final class ArcanistGitLandEngine $old_commits, $is_contains = false); - $api = $this->getRepositoryAPI(); foreach ($branch_map as $branch_name => $branch_hash) { $recovery_command = csprintf( 'git checkout -b %s %s', $branch_name, $this->getDisplayHash($branch_hash)); - echo tsprintf( - "%s\n", - pht('Cleaning up branch "%s"...', $branch_name)); + $log->writeStatus( + pht('CLEANUP'), + pht('Destroying branch "%s". To recover, run:', $branch_name)); echo tsprintf( - "%s\n", - pht('(Use `%s` if you want it back.)', $recovery_command)); + "\n **$** %s\n\n", + $recovery_command); $api->execxLocal('branch -D -- %s', $branch_name); $this->deletedBranches[$branch_name] = true;