2021-11-18 19:40:19 +03:00
|
|
|
# delete.namespace.force
|
|
|
|
|
2024-07-10 17:46:18 +03:00
|
|
|
``` 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.
|
|
|
|
|
2024-07-10 19:17:15 +03:00
|
|
|
``` ucm
|
2024-06-12 01:22:09 +03:00
|
|
|
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.
|
|
|
|
|
2024-07-10 19:17:15 +03:00
|
|
|
``` ucm
|
2024-06-12 01:22:09 +03:00
|
|
|
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
|
2022-02-08 05:29:57 +03:00
|
|
|
term2 1. dependents.usage1
|
|
|
|
2. dependents.usage2
|
2021-11-19 02:32:07 +03:00
|
|
|
|
2022-02-08 05:29:57 +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
|
2022-02-26 09:03:59 +03:00
|
|
|
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`
|
|
|
|
|
2024-07-10 19:17:15 +03:00
|
|
|
``` ucm
|
2024-06-12 01:22:09 +03:00
|
|
|
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
|
2022-02-08 05:29:57 +03:00
|
|
|
term2 1. dependents.usage1
|
|
|
|
2. dependents.usage2
|
2021-11-19 02:32:07 +03:00
|
|
|
|
2022-02-08 05:29:57 +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
|
|
|
|
2024-07-10 19:17:15 +03:00
|
|
|
``` ucm
|
2024-06-12 01:22:09 +03:00
|
|
|
scratch/main> view 2
|
2021-11-19 03:02:54 +03:00
|
|
|
|
2022-02-08 05:29:57 +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.
|
|
|
|
|
2024-07-10 19:17:15 +03:00
|
|
|
``` ucm
|
2024-06-12 01:22:09 +03:00
|
|
|
scratch/main> delete.namespace .
|
2021-11-18 20:43:29 +03:00
|
|
|
|
2024-07-02 20:28:59 +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
|
|
|
|
2024-06-28 01:23:29 +03:00
|
|
|
```
|
2024-07-02 20:28:59 +03:00
|
|
|
Deleting the root namespace shouldn't require confirmation if forced.
|
2021-11-18 20:43:29 +03:00
|
|
|
|
2024-07-10 19:17:15 +03:00
|
|
|
``` ucm
|
2024-07-02 20:28:59 +03:00
|
|
|
scratch/main> delete.namespace.force .
|
2021-11-18 20:43:29 +03:00
|
|
|
|
2024-07-02 20:28:59 +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
|
|
|
|
2024-07-02 20:28:59 +03:00
|
|
|
-- Should have an empty history
|
|
|
|
scratch/main> history .
|
2024-06-28 01:23:29 +03:00
|
|
|
|
2024-07-02 20:28:59 +03:00
|
|
|
Note: The most recent namespace hash is immediately below this
|
|
|
|
message.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
□ 1. #sg60bvjo91 (start of history)
|
2023-01-30 20:14:16 +03:00
|
|
|
|
2024-07-02 20:28:59 +03:00
|
|
|
```
|