Fix merging on empty namespaces

This commit is contained in:
Chris Penner 2021-12-08 16:39:48 -06:00
parent 9bd63c79f1
commit 7e1ba673a4
2 changed files with 41 additions and 47 deletions

View File

@ -677,7 +677,7 @@ loop = do
MergeLocalBranchI src0 dest0 mergeMode -> do
let [src, dest] = resolveToAbsolute <$> [src0, dest0]
srcb <- getAt src
if Branch.isEmpty0 (Branch.head srcb)
if Branch.isEmpty srcb
then branchNotFound src0
else do
let err = Just $ MergeAlreadyUpToDate src0 dest0
@ -685,7 +685,7 @@ loop = do
PreviewMergeLocalBranchI src0 dest0 -> do
let [src, dest] = resolveToAbsolute <$> [src0, dest0]
srcb <- getAt src
if Branch.isEmpty0 (Branch.head srcb)
if Branch.isEmpty srcb
then branchNotFound src0
else do
destb <- getAt dest

View File

@ -1,47 +1,3 @@
<<<<<<< HEAD
# Empty namespace behaviours
## Operations on empty namespaces
Add and then delete a term to add some history to a deleted namespace.
```unison
deleted.x = 1
stuff.thing = 2
```
I should be allowed to fork over a deleted namespace
```ucm
.> fork stuff deleted
Done.
```
The history from the `deleted` namespace should have been overwritten by the history from `stuff`.
```ucm
.> history stuff
Note: The most recent namespace hash is immediately below this
message.
#3bm1524lb7 (start of history)
.> history deleted
Note: The most recent namespace hash is immediately below this
message.
#3bm1524lb7 (start of history)
```
||||||| 138799f92
=======
# Empty namespace behaviours
```unison
@ -73,6 +29,8 @@ The deleted namespace shouldn't appear in `ls` output.
to supply command arguments.
```
## history
The history of the namespace should still exist if requested explicitly.
```ucm
@ -117,4 +75,40 @@ Merging an empty namespace should still copy its history if it has some.
#hkrqt3tm05 (start of history)
```
>>>>>>> trunk
Add and then delete a term to add some history to a deleted namespace.
```unison
deleted.x = 1
stuff.thing = 2
```
I should be allowed to fork over a deleted namespace
```ucm
.> fork stuff deleted
Done.
```
The history from the `deleted` namespace should have been overwritten by the history from `stuff`.
```ucm
.> history stuff
Note: The most recent namespace hash is immediately below this
message.
#3bm1524lb7 (start of history)
.> history deleted
Note: The most recent namespace hash is immediately below this
message.
#3bm1524lb7 (start of history)
```