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

121 lines
2.7 KiB
Markdown
Raw Permalink Normal View History

2021-11-18 19:40:19 +03:00
# delete.namespace.force
``` unison
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
```
Deleting a namespace with no external dependencies should succeed.
``` ucm
scratch/main> delete.namespace no_dependencies
2021-11-18 19:40:19 +03:00
2022-06-06 20:59:53 +03:00
Done.
2021-11-18 19:40:19 +03:00
```
Deleting a namespace with external dependencies should fail and list all dependents.
``` ucm
scratch/main> delete.namespace dependencies
2021-11-18 19:40:19 +03:00
⚠️
2021-11-19 02:32:07 +03:00
I didn't delete the namespace because the following
definitions are still in use.
2021-11-18 19:40:19 +03:00
2021-11-19 02:32:07 +03:00
Dependency Referenced In
term2 1. dependents.usage1
2. dependents.usage2
2021-11-19 02:32:07 +03:00
term1 3. dependents.usage1
4. dependents.usage2
2021-11-18 19:40:19 +03:00
2021-11-19 02:32:07 +03:00
If you want to proceed anyways and leave those definitions
without names, use delete.namespace.force
2021-11-18 19:40:19 +03:00
```
2021-11-18 20:43:29 +03:00
Deleting a namespace with external dependencies should succeed when using `delete.namespace.force`
``` ucm
scratch/main> delete.namespace.force dependencies
2021-11-18 20:43:29 +03:00
2022-06-06 20:59:53 +03:00
Done.
2021-11-18 20:43:29 +03:00
2021-11-19 02:32:07 +03:00
⚠️
2021-11-19 19:54:37 +03:00
Of the things I deleted, the following are still used in the
following definitions. They now contain un-named references.
2021-11-19 02:32:07 +03:00
Dependency Referenced In
term2 1. dependents.usage1
2. dependents.usage2
2021-11-19 02:32:07 +03:00
term1 3. dependents.usage1
4. dependents.usage2
2021-11-19 03:02:54 +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
dependents.usage2 : Nat
dependents.usage2 =
use Nat *
#gjmq673r1v * #dcgdua2lj6
2021-11-19 02:32:07 +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 .
2021-11-18 20:43:29 +03:00
⚠️
Are you sure you want to clear away everything?
You could use `project.create` to switch to a new project
instead, or delete the current branch with `delete.branch`
scratch/main> delete.namespace .
Okay, I deleted everything except the history. Use `undo` to
undo, or `builtins.merge` to restore the absolute basics to
the current path.
-- Should have an empty history
scratch/main> history .
Note: The most recent namespace hash is immediately below this
message.
□ 1. #sg60bvjo91 (start of history)
2021-11-18 20:43:29 +03:00
```
Deleting the root namespace shouldn't require confirmation if forced.
2021-11-18 20:43:29 +03:00
``` ucm
scratch/main> delete.namespace.force .
2021-11-18 20:43:29 +03:00
Okay, I deleted everything except the history. Use `undo` to
undo, or `builtins.merge` to restore the absolute basics to
the current path.
2023-01-30 20:14:16 +03:00
-- Should have an empty history
scratch/main> history .
Note: The most recent namespace hash is immediately below this
message.
□ 1. #sg60bvjo91 (start of history)
2023-01-30 20:14:16 +03:00
```