Docs and transcripts

This commit is contained in:
Chris Penner 2024-07-10 10:06:53 -07:00
parent 15431602ac
commit 67a41cdaf1
6 changed files with 12 additions and 10 deletions

1
.gitignore vendored
View File

@ -24,6 +24,7 @@ dist-newstyle
# GHC
*.hie
*.prof
*.prof.html
/.direnv/
/.envrc

View File

@ -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 ->

View File

@ -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 $

View File

@ -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

View File

@ -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
```

View File

@ -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