From 3666e04257e57c385ce6b8999632df61e8b76fba Mon Sep 17 00:00:00 2001 From: Chris Penner Date: Tue, 25 Jun 2024 17:15:00 -0700 Subject: [PATCH] Convert deep-names to use projects --- unison-src/transcripts/deep-names.md | 32 +++--- unison-src/transcripts/deep-names.output.md | 104 +++++++++++++++++--- 2 files changed, 107 insertions(+), 29 deletions(-) diff --git a/unison-src/transcripts/deep-names.md b/unison-src/transcripts/deep-names.md index aa000b578..9d6695bc4 100644 --- a/unison-src/transcripts/deep-names.md +++ b/unison-src/transcripts/deep-names.md @@ -13,35 +13,41 @@ http.z = 8 ```ucm:hide scratch/main> add +scratch/main> branch /app1 +scratch/main> branch /app2 ``` Our `app1` project includes the text library twice and the http library twice as direct dependencies. ```ucm -.app1> fork .text lib.text_v1 -.app1> fork .text lib.text_v2 -.app1> fork .http lib.http_v3 -.app1> fork .http lib.http_v4 +scratch/app1> fork text lib.text_v1 +scratch/app1> fork text lib.text_v2 +scratch/app1> delete.namespace text +scratch/app1> fork http lib.http_v3 +scratch/app1> fork http lib.http_v4 +scratch/app1> delete.namespace http ``` As such, we see two copies of `a` and two copies of `x` via these direct dependencies. ```ucm -.app1> names a -.app1> names x +scratch/app1> names a +scratch/app1> names x ``` Our `app2` project includes the `http` library twice as direct dependencies, and once as an indirect dependency via `webutil`. It also includes the `text` library twice as indirect dependencies via `webutil` ```ucm -.app2> fork .http lib.http_v1 -.app2> fork .http lib.http_v2 -.app2> fork .text lib.webutil.lib.text_v1 -.app2> fork .text lib.webutil.lib.text_v2 -.app2> fork .http lib.webutil.lib.http +scratch/app2> fork http lib.http_v1 +scratch/app2> fork http lib.http_v2 +scratch/app2> fork text lib.webutil.lib.text_v1 +scratch/app2> fork text lib.webutil.lib.text_v2 +scratch/app2> fork http lib.webutil.lib.http +scratch/app2> delete.namespace http +scratch/app2> delete.namespace text ``` Now we see two copies of `x` via direct dependencies on `http`, and one copy of `a` via indirect dependency on `text` via `webutil`. We see neither the second indirect copy of `a` nor the indirect copy of `x` via webutil because we already have names for them. ```ucm -.app2> names a -.app2> names x +scratch/app2> names a +scratch/app2> names x ``` diff --git a/unison-src/transcripts/deep-names.output.md b/unison-src/transcripts/deep-names.output.md index 958083bc1..833ae613a 100644 --- a/unison-src/transcripts/deep-names.output.md +++ b/unison-src/transcripts/deep-names.output.md @@ -13,27 +13,99 @@ http.z = 8 Our `app1` project includes the text library twice and the http library twice as direct dependencies. ```ucm - ☝️ The namespace .app1 is empty. +scratch/app1> fork text lib.text_v1 -.app1> fork .text lib.text_v1 + Done. - ⚠️ - - The namespace .text doesn't exist. +scratch/app1> fork text lib.text_v2 + + Done. + +scratch/app1> delete.namespace text + + Done. + +scratch/app1> fork http lib.http_v3 + + Done. + +scratch/app1> fork http lib.http_v4 + + Done. + +scratch/app1> delete.namespace http + + Done. ``` - +As such, we see two copies of `a` and two copies of `x` via these direct dependencies. ```ucm -.app1> fork .text lib.text_v1.app1> fork .text lib.text_v2.app1> fork .http lib.http_v3.app1> fork .http lib.http_v4 -``` +scratch/app1> names a - -🛑 - -The transcript failed due to an error in the stanza above. The error is: - - - ⚠️ + Term + Hash: #gjmq673r1v + Names: lib.text_v1.a lib.text_v2.a - The namespace .text doesn't exist. + Tip: Use `names.global` to see more results. +scratch/app1> names x + + Term + Hash: #nsmc4p1ra4 + Names: lib.http_v3.x lib.http_v4.x + + Tip: Use `names.global` to see more results. + +``` +Our `app2` project includes the `http` library twice as direct dependencies, and once as an indirect dependency via `webutil`. +It also includes the `text` library twice as indirect dependencies via `webutil` +```ucm +scratch/app2> fork http lib.http_v1 + + Done. + +scratch/app2> fork http lib.http_v2 + + Done. + +scratch/app2> fork text lib.webutil.lib.text_v1 + + Done. + +scratch/app2> fork text lib.webutil.lib.text_v2 + + Done. + +scratch/app2> fork http lib.webutil.lib.http + + Done. + +scratch/app2> delete.namespace http + + Done. + +scratch/app2> delete.namespace text + + Done. + +``` +Now we see two copies of `x` via direct dependencies on `http`, and one copy of `a` via indirect dependency on `text` via `webutil`. +We see neither the second indirect copy of `a` nor the indirect copy of `x` via webutil because we already have names for them. +```ucm +scratch/app2> names a + + Term + Hash: #gjmq673r1v + Names: lib.webutil.lib.text_v1.a + + Tip: Use `names.global` to see more results. + +scratch/app2> names x + + Term + Hash: #nsmc4p1ra4 + Names: lib.http_v1.x lib.http_v2.x + + Tip: Use `names.global` to see more results. + +```