mirror of
https://github.com/unisonweb/unison.git
synced 2024-09-11 02:25:39 +03:00
add basic transcripts
This commit is contained in:
parent
7601223d0a
commit
38706cd5e3
120
unison-src/transcripts/merge2.md
Normal file
120
unison-src/transcripts/merge2.md
Normal 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
|
||||
```
|
244
unison-src/transcripts/merge2.output.md
Normal file
244
unison-src/transcripts/merge2.output.md
Normal 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
|
||||
```
|
||||
|
Loading…
Reference in New Issue
Block a user