add conflict examples to merge2 transcript

This commit is contained in:
Travis Staton 2024-03-19 10:47:07 -04:00
parent 5cf61d6c51
commit 2e2fc04bdd
No known key found for this signature in database
GPG Key ID: 431DD911A00DAE49
2 changed files with 276 additions and 2 deletions

View File

@ -33,7 +33,7 @@ proj/main> view bar
.> project.delete proj
```
## Basic conflict
## Add/Add conflict
```ucm:hide
.> project.create-empty proj
@ -66,6 +66,91 @@ proj/main> merge2 /topic
.> project.delete proj
```
## Update/Update conflict
```ucm:hide
.> project.create-empty proj
proj/main> builtins.mergeio
```
```unison
foo : Nat
foo = 1
```
```ucm
proj/main> add
proj/main> branch topic
```
```unison
foo : Nat
foo = 2
```
```ucm
proj/topic> update
proj/main>
```
```unison
foo : Nat
foo = 3
```
```ucm
proj/main> update
```
```ucm:error
proj/main> merge2 /topic
```
```ucm:hide
.> project.delete proj
```
## Update/Delete conflict
We don't consider these, so this transcript is capturing our
ignorance.
```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> delete.term foo
```
```unison
foo : Nat
foo = 2
```
```ucm
proj/main> update
```
We silently ignore the delete
```ucm
proj/main> merge2 /topic
proj/main> view foo
```
```ucm:hide
.> project.delete proj
```
## Altered dependent
```ucm:hide

View File

@ -72,7 +72,7 @@ proj/main> view bar
foo + 1
```
## Basic conflict
## Add/Add conflict
```unison
foo : Nat
@ -140,6 +140,195 @@ foo : Nat
foo = 1
```
## Update/Update 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/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
foo : Nat
foo = 2
```
```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 : Nat
```
```ucm
proj/topic> update
Okay, I'm searching the branch for code that needs to be
updated...
Done.
```
```unison
foo : Nat
foo = 3
```
```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 : Nat
```
```ucm
proj/main> update
Okay, I'm searching the branch for code that needs to be
updated...
Done.
```
```ucm
proj/main> merge2 /topic
I couldn't automatically merge topic into main. However, I've
added the definitions that need attention to the top of
scratch.u.
```
```unison:added-by-ucm scratch.u
foo : Nat
foo = 3
foo : Nat
foo = 2
```
## Update/Delete conflict
We don't consider these, so this transcript is capturing our
ignorance.
```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.
proj/topic> delete.term foo
Done.
```
```unison
foo : Nat
foo = 2
```
```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> update
Okay, I'm searching the branch for code that needs to be
updated...
Done.
```
We silently ignore the delete
```ucm
proj/main> merge2 /topic
I merged topic into main.
proj/main> view foo
foo : Nat
foo = 2
```
## Altered dependent
`foo : Nat` is in the ancestor of `main` and `topic`