mirror of
https://github.com/unisonweb/unison.git
synced 2024-09-11 10:35:57 +03:00
Docs and transcripts
This commit is contained in:
parent
15431602ac
commit
67a41cdaf1
1
.gitignore
vendored
1
.gitignore
vendored
@ -24,6 +24,7 @@ dist-newstyle
|
||||
# GHC
|
||||
*.hie
|
||||
*.prof
|
||||
*.prof.html
|
||||
/.direnv/
|
||||
/.envrc
|
||||
|
||||
|
@ -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 ->
|
||||
|
@ -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 $
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
```
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user