diff --git a/.gitignore b/.gitignore index b182f70b4..94b29b69e 100644 --- a/.gitignore +++ b/.gitignore @@ -24,6 +24,7 @@ dist-newstyle # GHC *.hie *.prof +*.prof.html /.direnv/ /.envrc diff --git a/unison-cli/src/Unison/Codebase/Editor/HandleInput/Branch.hs b/unison-cli/src/Unison/Codebase/Editor/HandleInput/Branch.hs index 06335337e..6df6178d5 100644 --- a/unison-cli/src/Unison/Codebase/Editor/HandleInput/Branch.hs +++ b/unison-cli/src/Unison/Codebase/Editor/HandleInput/Branch.hs @@ -85,15 +85,15 @@ handleBranch sourceI projectAndBranchNames@(ProjectAndBranch mayProjectName newB ) (projectAndBranchNames & #project .~ projectName) --- | @createBranchFromParent createFrom project branch description@: +-- | @createBranch description createFrom project getNewBranchName@: -- --- 1. Creates a new branch row for @branch@ in project @project@ (failing if @branch@ already exists in @project@). --- 3. Switches to the new branch. +-- 1. Creates a new branch row in @project@ at the name from @getNewBranchName@ (failing if branch already exists in @project@). +-- 2. Switches to the new branch. -- -- This bit of functionality is factored out from the main 'handleBranch' handler because it is also called by the -- @release.draft@ command, which essentially just creates a branch, but with some different output for the user. -- --- Returns the branch id of the newly-created branch. +-- Returns the branch id and name of the newly-created branch. createBranch :: Text -> CreateFrom -> diff --git a/unison-cli/src/Unison/Codebase/Editor/HandleInput/DeleteBranch.hs b/unison-cli/src/Unison/Codebase/Editor/HandleInput/DeleteBranch.hs index 516215e93..ccbcfcb26 100644 --- a/unison-cli/src/Unison/Codebase/Editor/HandleInput/DeleteBranch.hs +++ b/unison-cli/src/Unison/Codebase/Editor/HandleInput/DeleteBranch.hs @@ -42,7 +42,7 @@ handleDeleteBranch projectAndBranchNamesToDelete = do -- 1. cd to parent branch, if it exists -- 2. cd to "main", if it exists -- 3. Any other branch in the codebase - -- 4. Create a dummy project and go to /main + -- 4. Create a new branch in the current project when (branchToDelete ^. #branchId == currentBranch ^. #branchId) do mayNextLocation <- Cli.runTransaction . runMaybeT $ diff --git a/unison-share-api/src/Unison/Server/Local/Endpoints/Current.hs b/unison-share-api/src/Unison/Server/Local/Endpoints/Current.hs index 48805f5b4..7d082b814 100644 --- a/unison-share-api/src/Unison/Server/Local/Endpoints/Current.hs +++ b/unison-share-api/src/Unison/Server/Local/Endpoints/Current.hs @@ -34,7 +34,7 @@ instance ToSample Current where Current (Just $ UnsafeProjectName "@unison/base") (Just $ UnsafeProjectBranchName "main") - (Path.Absolute $ Path.unsafeParseText ".my.namespace") + (Path.Absolute $ Path.unsafeParseText "my.path") ) ] @@ -46,10 +46,10 @@ instance ToJSON Current where "path" .= path ] -serveCurrent :: MonadIO m => Codebase m v a -> Backend m Current +serveCurrent :: (MonadIO m) => Codebase m v a -> Backend m Current serveCurrent = lift . getCurrentProjectBranch -getCurrentProjectBranch :: MonadIO m => Codebase m v a -> m Current +getCurrentProjectBranch :: (MonadIO m) => Codebase m v a -> m Current getCurrentProjectBranch codebase = do pp <- Codebase.runTransaction codebase Codebase.expectCurrentProjectPath let (PP.ProjectPath projName branchName path) = PP.toNames pp diff --git a/unison-src/transcripts-round-trip/main.md b/unison-src/transcripts-round-trip/main.md index 3ce811c29..7824c9cfe 100644 --- a/unison-src/transcripts-round-trip/main.md +++ b/unison-src/transcripts-round-trip/main.md @@ -1,6 +1,7 @@ This transcript verifies that the pretty-printer produces code that can be successfully parsed, for a variety of examples. Terms or types that fail to round-trip can be added to either `reparses-with-same-hash.u` or `reparses.u` as regression tests. ```ucm:hide +scratch/main> builtins.mergeio lib.builtins scratch/a1> builtins.mergeio lib.builtins scratch/a2> builtins.mergeio lib.builtins ``` diff --git a/unison-src/transcripts-round-trip/main.output.md b/unison-src/transcripts-round-trip/main.output.md index 7f8c0067d..f8fcb3964 100644 --- a/unison-src/transcripts-round-trip/main.output.md +++ b/unison-src/transcripts-round-trip/main.output.md @@ -824,9 +824,9 @@ scratch/main> diff.namespace /a3_new:. /a3:. Updates: - 1. sloppyDocEval : #ej86si0ur1 + 1. sloppyDocEval : Doc2 ↓ - 2. sloppyDocEval : #ej86si0ur1 + 2. sloppyDocEval : Doc2 ``` ## Other regression tests not covered by above