Skip to content

Commit

Permalink
Docs and transcripts
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisPenner committed Jul 10, 2024
1 parent 1543160 commit 67a41cd
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 10 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ dist-newstyle
# GHC
*.hie
*.prof
*.prof.html
/.direnv/
/.envrc

Expand Down
8 changes: 4 additions & 4 deletions unison-cli/src/Unison/Codebase/Editor/HandleInput/Branch.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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 ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 $
Expand Down
6 changes: 3 additions & 3 deletions unison-share-api/src/Unison/Server/Local/Endpoints/Current.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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")
)
]

Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions unison-src/transcripts-round-trip/main.md
Original file line number Diff line number Diff line change
@@ -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
```
Expand Down
4 changes: 2 additions & 2 deletions unison-src/transcripts-round-trip/main.output.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 67a41cd

Please sign in to comment.