From 25afb93f7ad49cc1d39685d5283165651351d278 Mon Sep 17 00:00:00 2001 From: epriestley Date: Fri, 5 Jun 2020 12:15:25 -0700 Subject: [PATCH] In "arc land", rebase branches in natural order Summary: Ref T13546. When "arc land" performs cascading rebases, do them in "feature1", "feature2", etc., order so they're easier to follow. The outcome is not dependent on execution order. Test Plan: Landed a change which cascaded many other branches, saw more comprehensible update order. Maniphest Tasks: T13546 Differential Revision: https://secure.phabricator.com/D21320 --- src/land/engine/ArcanistGitLandEngine.php | 5 +++++ src/land/engine/ArcanistLandEngine.php | 9 +++++++++ src/workflow/ArcanistWorkflow.php | 4 +++- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/land/engine/ArcanistGitLandEngine.php b/src/land/engine/ArcanistGitLandEngine.php index 48b2d95a..9e039d44 100644 --- a/src/land/engine/ArcanistGitLandEngine.php +++ b/src/land/engine/ArcanistGitLandEngine.php @@ -103,6 +103,11 @@ final class ArcanistGitLandEngine } } + // Sort the result so that branches are processed in natural order. + $names = array_keys($result); + natcasesort($names); + $result = array_select_keys($result, $names); + return $result; } diff --git a/src/land/engine/ArcanistLandEngine.php b/src/land/engine/ArcanistLandEngine.php index 051a21ae..7343c660 100644 --- a/src/land/engine/ArcanistLandEngine.php +++ b/src/land/engine/ArcanistLandEngine.php @@ -140,6 +140,15 @@ abstract class ArcanistLandEngine extends Phobject { return $this->shouldKeep; } + final public function setStrategyArgument($strategy_argument) { + $this->strategyArgument = $strategy_argument; + return $this; + } + + final public function getStrategyArgument() { + return $this->strategyArgument; + } + final public function setStrategy($strategy) { $this->strategy = $strategy; return $this; diff --git a/src/workflow/ArcanistWorkflow.php b/src/workflow/ArcanistWorkflow.php index 1e0a1093..5922c8a2 100644 --- a/src/workflow/ArcanistWorkflow.php +++ b/src/workflow/ArcanistWorkflow.php @@ -2357,11 +2357,13 @@ abstract class ArcanistWorkflow extends Phobject { $prompts = $this->newPrompts(); assert_instances_of($prompts, 'ArcanistPrompt'); + // TODO: Move this somewhere modular. + $prompts[] = $this->newPrompt('arc.state.stash') ->setDescription( pht( 'Prompts the user to stash changes and continue when the '. - 'working copy has untracked, uncommitted. or unstaged '. + 'working copy has untracked, uncommitted, or unstaged '. 'changes.')); // TODO: Swap to ArrayCheck?