2022-11-06 02:11:28 +03:00
|
|
|
First we'll set up two libraries, and then we'll use them in some projects and show what `names` are deep-loaded for them.
|
|
|
|
|
|
|
|
Our two "libraries":
|
2024-07-10 17:46:18 +03:00
|
|
|
|
|
|
|
``` unison
|
2022-11-06 02:11:28 +03:00
|
|
|
text.a = 1
|
|
|
|
text.b = 2
|
|
|
|
text.c = 3
|
|
|
|
|
|
|
|
http.x = 6
|
|
|
|
http.y = 7
|
|
|
|
http.z = 8
|
|
|
|
```
|
|
|
|
|
|
|
|
Our `app1` project includes the text library twice and the http library twice as direct dependencies.
|
2024-07-10 17:46:18 +03:00
|
|
|
|
2024-07-10 19:17:15 +03:00
|
|
|
``` ucm
|
2024-06-26 03:15:00 +03:00
|
|
|
scratch/app1> fork text lib.text_v1
|
2022-11-06 02:11:28 +03:00
|
|
|
|
2024-06-26 03:15:00 +03:00
|
|
|
Done.
|
2022-11-06 02:11:28 +03:00
|
|
|
|
2024-06-26 03:15:00 +03:00
|
|
|
scratch/app1> fork text lib.text_v2
|
2022-11-06 02:11:28 +03:00
|
|
|
|
2024-06-26 03:15:00 +03:00
|
|
|
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
|
2022-11-06 02:11:28 +03:00
|
|
|
|
2024-06-26 03:15:00 +03:00
|
|
|
Done.
|
|
|
|
|
|
|
|
```
|
|
|
|
As such, we see two copies of `a` and two copies of `x` via these direct dependencies.
|
2024-07-10 17:46:18 +03:00
|
|
|
|
2024-07-10 19:17:15 +03:00
|
|
|
``` ucm
|
2024-06-26 03:15:00 +03:00
|
|
|
scratch/app1> names a
|
|
|
|
|
|
|
|
Term
|
|
|
|
Hash: #gjmq673r1v
|
|
|
|
Names: lib.text_v1.a lib.text_v2.a
|
|
|
|
|
|
|
|
scratch/app1> names x
|
|
|
|
|
|
|
|
Term
|
|
|
|
Hash: #nsmc4p1ra4
|
|
|
|
Names: lib.http_v3.x lib.http_v4.x
|
|
|
|
|
2024-06-12 01:22:09 +03:00
|
|
|
```
|
2024-06-26 03:15:00 +03:00
|
|
|
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`
|
2024-07-10 17:46:18 +03:00
|
|
|
|
2024-07-10 19:17:15 +03:00
|
|
|
``` ucm
|
2024-06-26 03:15:00 +03:00
|
|
|
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
|
2022-11-06 02:11:28 +03:00
|
|
|
|
2024-06-26 03:15:00 +03:00
|
|
|
Done.
|
2022-11-06 02:11:28 +03:00
|
|
|
|
2024-06-26 03:15:00 +03:00
|
|
|
scratch/app2> delete.namespace http
|
2022-11-06 02:11:28 +03:00
|
|
|
|
2024-06-26 03:15:00 +03:00
|
|
|
Done.
|
2022-11-06 02:11:28 +03:00
|
|
|
|
2024-06-26 03:15:00 +03:00
|
|
|
scratch/app2> delete.namespace text
|
2022-11-06 02:11:28 +03:00
|
|
|
|
2024-06-26 03:15:00 +03:00
|
|
|
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.
|
2024-07-10 17:46:18 +03:00
|
|
|
|
2024-07-10 19:17:15 +03:00
|
|
|
``` ucm
|
2024-06-26 03:15:00 +03:00
|
|
|
scratch/app2> names a
|
|
|
|
|
|
|
|
Term
|
|
|
|
Hash: #gjmq673r1v
|
|
|
|
Names: lib.webutil.lib.text_v1.a
|
2022-11-06 02:11:28 +03:00
|
|
|
|
2024-06-26 03:15:00 +03:00
|
|
|
scratch/app2> names x
|
|
|
|
|
|
|
|
Term
|
|
|
|
Hash: #nsmc4p1ra4
|
|
|
|
Names: lib.http_v1.x lib.http_v2.x
|
|
|
|
|
|
|
|
```
|