unison/unison-src/transcripts/delete-namespace.output.md
Arya Irani 0cd3cd1cff Merge branch 'trunk' into cp/project-root
# Conflicts:
#	unison-cli-integration/integration-tests/IntegrationTests/transcript.output.md
#	unison-src/transcripts-round-trip/main.output.md
#	unison-src/transcripts/add-run.output.md
#	unison-src/transcripts/bug-strange-closure.output.md
#	unison-src/transcripts/cycle-update-5.output.md
#	unison-src/transcripts/delete.output.md
#	unison-src/transcripts/diff-namespace.output.md
#	unison-src/transcripts/move-namespace.output.md
#	unison-src/transcripts/name-selection.output.md
#	unison-src/transcripts/names.output.md
#	unison-src/transcripts/namespace-dependencies.output.md
#	unison-src/transcripts/propagate.output.md
#	unison-src/transcripts/reflog.output.md
#	unison-src/transcripts/reset.output.md
#	unison-src/transcripts/tab-completion.output.md
#	unison-src/transcripts/transcript-parser-commands.output.md
2024-07-10 23:49:04 -04:00

2.7 KiB

delete.namespace.force

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.

scratch/main> delete.namespace no_dependencies

  Done.

Deleting a namespace with external dependencies should fail and list all dependents.

scratch/main> delete.namespace dependencies

  ⚠️
  
  I didn't delete the namespace because the following
  definitions are still in use.
  
  Dependency   Referenced In
  term2        1. dependents.usage1
               2. dependents.usage2
               
  term1        3. dependents.usage1
               4. dependents.usage2
  
  If you want to proceed anyways and leave those definitions
  without names, use delete.namespace.force

Deleting a namespace with external dependencies should succeed when using delete.namespace.force

scratch/main> delete.namespace.force dependencies

  Done.

  ⚠️
  
  Of the things I deleted, the following are still used in the
  following definitions. They now contain un-named references.
  
  Dependency   Referenced In
  term2        1. dependents.usage1
               2. dependents.usage2
               
  term1        3. dependents.usage1
               4. dependents.usage2

I should be able to view an affected dependency by number

scratch/main> view 2

  dependents.usage2 : Nat
  dependents.usage2 =
    use Nat *
    #gjmq673r1v * #dcgdua2lj6

Deleting the root namespace should require confirmation if not forced.

scratch/main> delete.namespace .

  ⚠️
  
  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)

Deleting the root namespace shouldn't require confirmation if forced.

scratch/main> delete.namespace.force .

  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)