Skip to content

Commit

Permalink
Merge pull request #5146 from unisonweb/24-06-26-port-old-merge-trans…
Browse files Browse the repository at this point in the history
…cripts
  • Loading branch information
aryairani authored Jun 28, 2024
2 parents 0558509 + d1f2d78 commit 71eed21
Show file tree
Hide file tree
Showing 8 changed files with 157 additions and 381 deletions.
34 changes: 4 additions & 30 deletions unison-src/transcripts/delete.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,55 +32,32 @@ How about an ambiguous term?

```unison:hide
foo = 1
bar = 2
```

```ucm
.a> add
```

```unison:hide
foo = 2
```

```ucm
.b> add
.a> merge.old .b
.a> debug.alias.term.force bar foo
```

A delete should remove both versions of the term.

```ucm
.> delete.verbose a.foo
```

```ucm:error
.a> ls
```

Let's repeat all that on a type, for completeness.

```unison:hide
structural type Foo = Foo ()
structural type Bar = Bar
```

```ucm
.a> add
```

```unison:hide
structural type Foo = Foo
```

```ucm
.b> add
.a> merge.old .b
```

```ucm
.a> debug.alias.type.force Bar Foo
.> delete.verbose a.Foo
```

```ucm
.> delete.verbose a.Foo.Foo
```

Expand All @@ -93,9 +70,6 @@ structural type foo = Foo ()

```ucm
.> add
```

```ucm
.> delete.verbose foo
```

Expand Down
100 changes: 13 additions & 87 deletions unison-src/transcripts/delete.output.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ How about an ambiguous term?

```unison
foo = 1
bar = 2
```

```ucm
Expand All @@ -68,40 +69,12 @@ foo = 1
⍟ I've added these definitions:
bar : ##Nat
foo : ##Nat
```
```unison
foo = 2
```
.a> debug.alias.term.force bar foo
```ucm
☝️ The namespace .b is empty.
.b> add
⍟ I've added these definitions:
foo : ##Nat
.a> merge.old .b
Here's what's changed in the current namespace after the
merge:
New name conflicts:
1. foo#gjmq673r1v : ##Nat
2. ┌ foo#dcgdua2lj6 : ##Nat
3. └ foo#gjmq673r1v : ##Nat
Tip: You can use `todo` to see if this generated any work to
do in this namespace and `test` to run the tests. Or you
can use `undo` or `reflog` to undo the results of this
merge.
Applying changes from patch...
Done.
```
A delete should remove both versions of the term.
Expand All @@ -116,71 +89,35 @@ A delete should remove both versions of the term.
Name changes:
Original Changes
2. b.foo ┐ 3. a.foo#dcgdua2lj6 (removed)
2. a.bar ┐ 3. a.foo#dcgdua2lj6 (removed)
4. a.foo#dcgdua2lj6 ┘
Tip: You can use `undo` or `reflog` to undo this change.
```
```ucm
☝️ The namespace .a is empty.
.a> ls
nothing to show
1. bar (##Nat)
```
Let's repeat all that on a type, for completeness.

```unison
structural type Foo = Foo ()
structural type Bar = Bar
```

```ucm
.a> add
⍟ I've added these definitions:
structural type Bar
structural type Foo
```
```unison
structural type Foo = Foo
```

```ucm
.b> add
⍟ I've added these definitions:
structural type Foo
.a> merge.old .b
.a> debug.alias.type.force Bar Foo
Here's what's changed in the current namespace after the
merge:
New name conflicts:
1. structural type Foo#089vmor9c5
2. ┌ structural type Foo#00nv2kob8f
3. └ structural type Foo#089vmor9c5
4. Foo.Foo#089vmor9c5#0 : 'Foo#089vmor9c5
5. ┌ Foo.Foo#00nv2kob8f#0 : ()
6. └ Foo.Foo#089vmor9c5#0 : 'Foo#089vmor9c5
Tip: You can use `todo` to see if this generated any work to
do in this namespace and `test` to run the tests. Or you
can use `undo` or `reflog` to undo the results of this
merge.
Done.
Applying changes from patch...
```
```ucm
.> delete.verbose a.Foo
Removed definitions:
Expand All @@ -190,26 +127,17 @@ structural type Foo = Foo
Name changes:
Original Changes
2. b.Foo ┐ 3. a.Foo#00nv2kob8f (removed)
2. a.Bar ┐ 3. a.Foo#00nv2kob8f (removed)
4. builtin.Unit │
5. a.Foo#00nv2kob8f ┘
Tip: You can use `undo` or `reflog` to undo this change.
```
```ucm
.> delete.verbose a.Foo.Foo
Removed definitions:
1. a.Foo.Foo#089vmor9c5#0 : '#089vmor9c5
Name changes:
Original Changes
2. b.Foo.Foo ┐ 3. a.Foo.Foo#00nv2kob8f#0 (removed)
4. builtin.Unit.Unit │
5. a.Foo.Foo#00nv2kob8f#0 ┘
1. a.Foo.Foo : '#089vmor9c5
Tip: You can use `undo` or `reflog` to undo this change.
Expand All @@ -229,8 +157,6 @@ structural type foo = Foo ()
structural type foo
foo : Nat
```
```ucm
.> delete.verbose foo
Removed definitions:
Expand Down Expand Up @@ -354,7 +280,7 @@ d = a + b + c
a : Nat
b : Nat
(also named b.foo)
(also named a.bar)
c : Nat
d : Nat
Expand Down
40 changes: 22 additions & 18 deletions unison-src/transcripts/diff-namespace.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,19 @@
```

```unison:hide
x = 23
b1.x = 23
b1.fslkdjflskdjflksjdf = 663
b2.x = 23
b2.fslkdjflskdjflksjdf = 23
b2.abc = 23
```

```ucm
.b1> add
.b1> alias.term x fslkdjflskdjflksjdf
.> fork b1 b2
.b2> alias.term x abc
```

```unison:hide
fslkdjflskdjflksjdf = 663
.> add
.> debug.alias.term.force b1.x b1.fslkdjflskdjflksjdf
```

```ucm
.b0> add
.> merge.old b0 b1
.> diff.namespace b1 b2
.b2> diff.namespace .b1
```
Expand Down Expand Up @@ -63,12 +59,13 @@ Here's what we've done so far:
```

```unison:hide
fromJust = "asldkfjasldkfj"
junk = "asldkfjasldkfj"
```

```ucm
.ns1b> add
.> merge.old ns1b ns1
.ns1> add
.ns1> debug.alias.term.force junk fromJust
.ns1> delete.term junk
```

```unison:hide
Expand Down Expand Up @@ -104,33 +101,40 @@ bdependent = "banana"


## Two different auto-propagated changes creating a name conflict

Currently, the auto-propagated name-conflicted definitions are not explicitly
shown, only their also-conflicted dependency is shown.

```unison:hide
a = 333
b = a + 1
```

```ucm
.nsx> add
.> fork nsx nsy
.> fork nsx nsz
```

```unison:hide
a = 444
```

```ucm
.nsy> update.old
```

```unison:hide
a = 555
```

```ucm
.nsz> update.old
.> merge.old nsy nsw
```
```ucm:error
.> merge.old nsz nsw
.> fork nsy nsw
.> debug.alias.term.force nsz.a nsw.a
.> debug.alias.term.force nsz.b nsw.b
```

```ucm
.> diff.namespace nsx nsw
.nsw> view a b
Expand Down
Loading

0 comments on commit 71eed21

Please sign in to comment.