add basic transcripts

This commit is contained in:
Travis Staton 2024-03-18 13:24:22 -04:00
parent 7601223d0a
commit 38706cd5e3
No known key found for this signature in database
GPG Key ID: 431DD911A00DAE49
2 changed files with 364 additions and 0 deletions

View File

@ -0,0 +1,120 @@
# tests for the new merge command
## Basic fast-forward merge
```ucm:hide
.> project.create-empty proj
proj/main> builtins.mergeio
```
```unison
foo : Nat
foo = 1
```
```ucm
proj/main> add
proj/main> branch topic
proj/topic>
```
```unison
bar : Nat
bar = foo + 1
```
```ucm
proj/topic> add
proj/main> merge2 /topic
proj/main> view bar
```
```ucm:hide
.> project.delete proj
```
## Basic conflict
```ucm:hide
.> project.create-empty proj
proj/main> builtins.mergeio
proj/main> branch topic
proj/topic>
```
```unison
foo : Nat
foo = 1
```
```ucm
proj/topic> add
proj/main>
```
```unison
foo : Nat
foo = 4
```
```ucm
proj/main> add
proj/main> merge2 /topic
```
```ucm:hide
.> project.delete proj
```
## Altered dependent
```ucm:hide
.> project.create-empty proj
proj/main> builtins.mergeio
```
`foo : Nat` is in the ancestor of `main` and `topic`
```unison
foo : Nat
foo = 1
```
```ucm
proj/main> add
proj/main> branch topic
proj/topic>
```
`topic` adds a dependent of `foo`
```unison
bar : Nat
bar = foo + 1
```
```ucm
proj/topic> add
proj/main>
```
`main` changes the type of `foo`
```unison
foo : Int
foo = +1
```
```ucm
proj/main> update
```
attempt to merge `topic` into `main`
```ucm
proj/main> merge2 /topic
```
```ucm:hide
.> project.delete proj
```

View File

@ -0,0 +1,244 @@
# tests for the new merge command
## Basic fast-forward merge
```unison
foo : Nat
foo = 1
```
```ucm
Loading changes detected in scratch.u.
I found and typechecked these definitions in scratch.u. If you
do an `add` or `update`, here's how your codebase would
change:
⍟ These new definitions are ok to `add`:
foo : Nat
```
```ucm
proj/main> add
⍟ I've added these definitions:
foo : Nat
proj/main> branch topic
Done. I've created the topic branch based off of main.
Tip: Use `merge /topic /main` to merge your work back into the
main branch.
```
```unison
bar : Nat
bar = foo + 1
```
```ucm
Loading changes detected in scratch.u.
I found and typechecked these definitions in scratch.u. If you
do an `add` or `update`, here's how your codebase would
change:
⍟ These new definitions are ok to `add`:
bar : Nat
```
```ucm
proj/topic> add
⍟ I've added these definitions:
bar : Nat
proj/main> merge2 /topic
proj/main> view bar
bar : Nat
bar =
use Nat +
foo + 1
```
## Basic conflict
```unison
foo : Nat
foo = 1
```
```ucm
Loading changes detected in scratch.u.
I found and typechecked these definitions in scratch.u. If you
do an `add` or `update`, here's how your codebase would
change:
⍟ These new definitions are ok to `add`:
foo : Nat
```
```ucm
proj/topic> add
⍟ I've added these definitions:
foo : Nat
```
```unison
foo : Nat
foo = 4
```
```ucm
Loading changes detected in scratch.u.
I found and typechecked these definitions in scratch.u. If you
do an `add` or `update`, here's how your codebase would
change:
⍟ These new definitions are ok to `add`:
foo : Nat
```
```ucm
proj/main> add
⍟ I've added these definitions:
foo : Nat
proj/main> merge2 /topic
```
```unison:added-by-ucm scratch.u
foo : Nat
foo = 4
foo : Nat
foo = 1
```
## Altered dependent
`foo : Nat` is in the ancestor of `main` and `topic`
```unison
foo : Nat
foo = 1
```
```ucm
Loading changes detected in scratch.u.
I found and typechecked these definitions in scratch.u. If you
do an `add` or `update`, here's how your codebase would
change:
⍟ These new definitions are ok to `add`:
foo : Nat
```
```ucm
proj/main> add
⍟ I've added these definitions:
foo : Nat
proj/main> branch topic
Done. I've created the topic branch based off of main.
Tip: Use `merge /topic /main` to merge your work back into the
main branch.
```
`topic` adds a dependent of `foo`
```unison
bar : Nat
bar = foo + 1
```
```ucm
Loading changes detected in scratch.u.
I found and typechecked these definitions in scratch.u. If you
do an `add` or `update`, here's how your codebase would
change:
⍟ These new definitions are ok to `add`:
bar : Nat
```
```ucm
proj/topic> add
⍟ I've added these definitions:
bar : Nat
```
`main` changes the type of `foo`
```unison
foo : Int
foo = +1
```
```ucm
Loading changes detected in scratch.u.
I found and typechecked these definitions in scratch.u. If you
do an `add` or `update`, here's how your codebase would
change:
⍟ These names already exist. You can `update` them to your
new definition:
foo : Int
```
```ucm
proj/main> update
Okay, I'm searching the branch for code that needs to be
updated...
Done.
```
attempt to merge `topic` into `main`
```ucm
proj/main> merge2 /topic
```
```unison:added-by-ucm scratch.u
bar : Nat
bar =
use Nat +
foo + 1
```