don't consider update+delete a conflicted alias

This commit is contained in:
Mitchell Rosen 2024-06-10 13:57:22 -04:00
parent 528c2a1cd6
commit e3440a91c6
3 changed files with 4 additions and 16 deletions

View File

@ -974,6 +974,8 @@ findConflictedAlias defns diff =
g hashed1 alias =
case Map.lookup alias diff of
Just (DiffOp'Update hashed2) | hashed1 == hashed2.new -> Nothing
-- If "foo" was updated but its alias "bar" was deleted, that's ok
Just (DiffOp'Delete _) -> Nothing
_ -> Just (name, alias)
-- Given a name like "base", try "base__1", then "base__2", etc, until we find a name that doesn't

View File

@ -1406,7 +1406,7 @@ bob = 101
project/bob> add
```
```ucm:error
```ucm
project/alice> merge /bob
```

View File

@ -1428,20 +1428,6 @@ project/bob> add
```ucm
project/alice> merge /bob
Sorry, I wasn't able to perform the merge:
On the merge ancestor, foo and bar were aliases for the same
definition, but on project/alice the names have different
definitions currently. I'd need just a single new definition
to use in their dependents when I merge.
Please fix up project/alice to resolve this. For example,
* `update` the definitions to be the same again, so that
there's nothing for me to decide.
* `move` or `delete` all but one of the definitions; I'll
use the remaining name when propagating updates.
and then try merging again.
I merged project/bob into project/alice.
```