2021-11-18 19:40:19 +03:00
|
|
|
# delete.namespace.force
|
|
|
|
|
|
|
|
```ucm:hide
|
2024-06-12 01:22:09 +03:00
|
|
|
scratch/main> builtins.merge
|
2021-11-18 19:40:19 +03:00
|
|
|
```
|
|
|
|
|
2021-11-18 20:43:29 +03:00
|
|
|
```unison:hide
|
2021-11-18 19:40:19 +03:00
|
|
|
no_dependencies.thing = "no dependents on this term"
|
|
|
|
|
|
|
|
dependencies.term1 = 1
|
|
|
|
dependencies.term2 = 2
|
|
|
|
|
|
|
|
dependents.usage1 = dependencies.term1 + dependencies.term2
|
|
|
|
dependents.usage2 = dependencies.term1 * dependencies.term2
|
|
|
|
```
|
|
|
|
|
|
|
|
```ucm:hide
|
2024-06-12 01:22:09 +03:00
|
|
|
scratch/main> add
|
2021-11-18 19:40:19 +03:00
|
|
|
```
|
|
|
|
|
|
|
|
Deleting a namespace with no external dependencies should succeed.
|
|
|
|
|
|
|
|
```ucm
|
2024-06-12 01:22:09 +03:00
|
|
|
scratch/main> delete.namespace no_dependencies
|
2021-11-18 19:40:19 +03:00
|
|
|
```
|
|
|
|
|
|
|
|
Deleting a namespace with external dependencies should fail and list all dependents.
|
|
|
|
|
|
|
|
```ucm:error
|
2024-06-12 01:22:09 +03:00
|
|
|
scratch/main> delete.namespace dependencies
|
2021-11-18 19:40:19 +03:00
|
|
|
```
|
|
|
|
|
|
|
|
Deleting a namespace with external dependencies should succeed when using `delete.namespace.force`
|
|
|
|
|
2021-11-18 20:43:29 +03:00
|
|
|
```ucm
|
2024-06-12 01:22:09 +03:00
|
|
|
scratch/main> delete.namespace.force dependencies
|
2021-11-18 19:40:19 +03:00
|
|
|
```
|
2021-11-18 20:43:29 +03:00
|
|
|
|
2021-11-19 03:37:12 +03:00
|
|
|
I should be able to view an affected dependency by number
|
2021-11-19 03:02:54 +03:00
|
|
|
|
|
|
|
```ucm
|
2024-06-12 01:22:09 +03:00
|
|
|
scratch/main> view 2
|
2021-11-19 03:02:54 +03:00
|
|
|
```
|
|
|
|
|
2021-11-18 20:43:29 +03:00
|
|
|
Deleting the root namespace should require confirmation if not forced.
|
|
|
|
|
|
|
|
```ucm
|
2024-06-12 01:22:09 +03:00
|
|
|
scratch/main> delete.namespace .
|
|
|
|
scratch/main> delete.namespace .
|
2023-01-30 20:14:16 +03:00
|
|
|
-- Should have an empty history
|
2024-06-12 01:22:09 +03:00
|
|
|
scratch/main> history .
|
2021-11-18 20:43:29 +03:00
|
|
|
```
|
|
|
|
|
|
|
|
Deleting the root namespace shouldn't require confirmation if forced.
|
|
|
|
|
|
|
|
```ucm
|
2024-06-12 01:22:09 +03:00
|
|
|
scratch/main> delete.namespace.force .
|
2023-01-30 20:14:16 +03:00
|
|
|
-- Should have an empty history
|
2024-06-12 01:22:09 +03:00
|
|
|
scratch/main> history .
|
2021-11-18 20:43:29 +03:00
|
|
|
```
|
|
|
|
|