unison/unison-src/transcripts/delete-namespace.md

62 lines
1.2 KiB
Markdown
Raw Permalink Normal View History

2021-11-18 19:40:19 +03:00
# delete.namespace.force
```ucm:hide
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
scratch/main> add
2021-11-18 19:40:19 +03:00
```
Deleting a namespace with no external dependencies should succeed.
```ucm
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
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
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
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
scratch/main> delete.namespace .
scratch/main> delete.namespace .
2023-01-30 20:14:16 +03:00
-- Should have an empty history
scratch/main> history .
2021-11-18 20:43:29 +03:00
```
Deleting the root namespace shouldn't require confirmation if forced.
```ucm
scratch/main> delete.namespace.force .
2023-01-30 20:14:16 +03:00
-- Should have an empty history
scratch/main> history .
2021-11-18 20:43:29 +03:00
```