diff --git a/parser-typechecker/src/Unison/Codebase/Editor.hs b/parser-typechecker/src/Unison/Codebase/Editor.hs index a05af41c2..932f6b442 100644 --- a/parser-typechecker/src/Unison/Codebase/Editor.hs +++ b/parser-typechecker/src/Unison/Codebase/Editor.hs @@ -199,6 +199,8 @@ type ListDetailed = Bool data Output v = Success Input + | CreatedBranch BranchName + | SwitchedBranch BranchName | NoUnisonFile | UnknownBranch BranchName | RenameOutput Name Name NameChangeResult diff --git a/parser-typechecker/src/Unison/Codebase/Editor/Actions.hs b/parser-typechecker/src/Unison/Codebase/Editor/Actions.hs index d57d49e9a..27415c4f8 100644 --- a/parser-typechecker/src/Unison/Codebase/Editor/Actions.hs +++ b/parser-typechecker/src/Unison/Codebase/Editor/Actions.hs @@ -289,9 +289,11 @@ loop = do _ <- eval $ NewBranch newBranch branchName currentBranch .= newBranch currentBranchName .= branchName + respond $ CreatedBranch $ branchName Just branch -> do currentBranch .= branch currentBranchName .= branchName + respond $ SwitchedBranch $ branchName quit = MaybeT $ pure Nothing eval :: Command i v a -> Action i v a diff --git a/parser-typechecker/src/Unison/CommandLine/OutputMessages.hs b/parser-typechecker/src/Unison/CommandLine/OutputMessages.hs index 5dc245b01..c6948f088 100644 --- a/parser-typechecker/src/Unison/CommandLine/OutputMessages.hs +++ b/parser-typechecker/src/Unison/CommandLine/OutputMessages.hs @@ -93,6 +93,9 @@ notifyUser dir o = case o of $ "I don't know of a branch named " <> P.red (P.text branchName) <> "." + CreatedBranch branchName -> + putPrettyLn $ "Created the new branch " <> backtickEOS (P.text branchName) + SwitchedBranch _branchName -> pure () -- putPrettyLn "Switched." RenameOutput oldName newName r -> do nameChange "rename" "renamed" oldName newName r AliasOutput existingName newName r -> do