From d9a5d111a159fb5567a06d1e768f696b8975db35 Mon Sep 17 00:00:00 2001 From: Eric Hanson <5846501+ericphanson@users.noreply.github.com> Date: Fri, 23 Feb 2024 18:21:10 +0100 Subject: [PATCH 1/4] Tweak wording to make "no changes" message more accurate --- src/Operations.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Operations.jl b/src/Operations.jl index a46a470fe3..0cd323d3ef 100644 --- a/src/Operations.jl +++ b/src/Operations.jl @@ -2302,7 +2302,7 @@ function print_status(env::EnvCache, old_env::Union{Nothing,EnvCache}, registrie end no_changes = all(p-> p[2] == p[3], xs) if no_changes - printpkgstyle(io, Symbol("No Changes"), "to $(pathrepr(manifest ? env.manifest_file : env.project_file))", ignore_indent) + printpkgstyle(io, Symbol("No added or removed packages"), "in $(pathrepr(manifest ? env.manifest_file : env.project_file))", ignore_indent) else xs = !filter ? xs : eltype(xs)[(id, old, new) for (id, old, new) in xs if (id in uuids || something(new, old).name in names)] if isempty(xs) From 5e32842dec4b3d2f4221962160f448feb0153361 Mon Sep 17 00:00:00 2001 From: Eric Hanson <5846501+ericphanson@users.noreply.github.com> Date: Fri, 23 Feb 2024 19:36:51 +0100 Subject: [PATCH 2/4] update tests/docs --- docs/src/environments.md | 4 ++-- test/new.jl | 16 ++++++++-------- test/resolve.jl | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/src/environments.md b/docs/src/environments.md index fd6fff9ab4..502d256812 100644 --- a/docs/src/environments.md +++ b/docs/src/environments.md @@ -70,8 +70,8 @@ Cloning into 'Example.jl'... Activating project at `~/Example.jl` (Example) pkg> instantiate - No Changes to `~/Example.jl/Project.toml` - No Changes to `~/Example.jl/Manifest.toml` + No added or removed packages to `~/Example.jl/Project.toml` + No added or removed packages to `~/Example.jl/Manifest.toml` ``` If the project contains a manifest, this will install the packages in the same state that is given by that manifest. diff --git a/test/new.jl b/test/new.jl index 6ab8e6a6d7..81394668ed 100644 --- a/test/new.jl +++ b/test/new.jl @@ -2278,8 +2278,8 @@ end # Double add should not claim "Updating" Pkg.add(Pkg.PackageSpec(; name="Example", version="0.3.0"); io=io) output = String(take!(io)) - @test occursin(r"No Changes to `.+Project\.toml`", output) - @test occursin(r"No Changes to `.+Manifest\.toml`", output) + @test occursin(r"No added or removed packages to `.+Project\.toml`", output) + @test occursin(r"No added or removed packages to `.+Manifest\.toml`", output) # From tracking registry to tracking repo Pkg.add(Pkg.PackageSpec(; name="Example", rev="master"); io=io) output = String(take!(io)) @@ -2401,22 +2401,22 @@ end git_init_and_commit(projdir) ## empty project + empty diff Pkg.status(; io=io, diff=true) - @test occursin(r"No Changes to `.+Project\.toml`", readline(io)) + @test occursin(r"No added or removed packages to `.+Project\.toml`", readline(io)) Pkg.status(; io=io, mode=Pkg.PKGMODE_MANIFEST, diff=true) - @test occursin(r"No Changes to `.+Manifest\.toml`", readline(io)) + @test occursin(r"No added or removed packages to `.+Manifest\.toml`", readline(io)) ### empty diff + filter Pkg.status("Example"; io=io, diff=true) - @test occursin(r"No Changes to `.+Project\.toml`", readline(io)) + @test occursin(r"No added or removed packages to `.+Project\.toml`", readline(io)) ## non-empty project but empty diff Pkg.add("Markdown") git_init_and_commit(dirname(Pkg.project().path)) Pkg.status(; io=io, diff=true) - @test occursin(r"No Changes to `.+Project\.toml`", readline(io)) + @test occursin(r"No added or removed packages to `.+Project\.toml`", readline(io)) Pkg.status(; io=io, mode=Pkg.PKGMODE_MANIFEST, diff=true) - @test occursin(r"No Changes to `.+Manifest\.toml`", readline(io)) + @test occursin(r"No added or removed packages to `.+Manifest\.toml`", readline(io)) ### filter should still show "empty diff" Pkg.status("Example"; io=io, diff=true) - @test occursin(r"No Changes to `.+Project\.toml`", readline(io)) + @test occursin(r"No added or removed packages to `.+Project\.toml`", readline(io)) ## non-empty project + non-empty diff Pkg.rm("Markdown") Pkg.add(name="Example", version="0.3.0") diff --git a/test/resolve.jl b/test/resolve.jl index f45e12b20f..07443b6d7d 100644 --- a/test/resolve.jl +++ b/test/resolve.jl @@ -740,8 +740,8 @@ end iob = IOBuffer() Pkg.resolve(io = iob) str = String(take!(iob)) - @test occursin(r"No Changes to .*Project.toml", str) - @test occursin(r"No Changes to .*Manifest.toml", str) + @test occursin(r"No added or removed packages to .*Project.toml", str) + @test occursin(r"No added or removed packages to .*Manifest.toml", str) end end From b20acfead4daf55c2ad5f4288a770970481a147c Mon Sep 17 00:00:00 2001 From: Eric Hanson <5846501+ericphanson@users.noreply.github.com> Date: Fri, 23 Feb 2024 19:37:04 +0100 Subject: [PATCH 3/4] tweak version for new msg --- docs/src/environments.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/environments.md b/docs/src/environments.md index 502d256812..8df532615b 100644 --- a/docs/src/environments.md +++ b/docs/src/environments.md @@ -66,7 +66,7 @@ shell> git clone https://github.com/JuliaLang/Example.jl.git Cloning into 'Example.jl'... ... -(@v1.9) pkg> activate Example.jl +(@v1.12) pkg> activate Example.jl Activating project at `~/Example.jl` (Example) pkg> instantiate From d330d9cf5fb60fab309e4348ec6eadc07fdc23b5 Mon Sep 17 00:00:00 2001 From: Eric Hanson <5846501+ericphanson@users.noreply.github.com> Date: Fri, 23 Feb 2024 22:35:18 +0100 Subject: [PATCH 4/4] tweak message --- docs/src/environments.md | 4 ++-- src/Operations.jl | 2 +- test/new.jl | 16 ++++++++-------- test/resolve.jl | 4 ++-- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/src/environments.md b/docs/src/environments.md index 8df532615b..50bc1adc85 100644 --- a/docs/src/environments.md +++ b/docs/src/environments.md @@ -70,8 +70,8 @@ Cloning into 'Example.jl'... Activating project at `~/Example.jl` (Example) pkg> instantiate - No added or removed packages to `~/Example.jl/Project.toml` - No added or removed packages to `~/Example.jl/Manifest.toml` + No packages added to or removed from `~/Example.jl/Project.toml` + No packages added to or removed from `~/Example.jl/Manifest.toml` ``` If the project contains a manifest, this will install the packages in the same state that is given by that manifest. diff --git a/src/Operations.jl b/src/Operations.jl index 0cd323d3ef..8e193ee8cb 100644 --- a/src/Operations.jl +++ b/src/Operations.jl @@ -2302,7 +2302,7 @@ function print_status(env::EnvCache, old_env::Union{Nothing,EnvCache}, registrie end no_changes = all(p-> p[2] == p[3], xs) if no_changes - printpkgstyle(io, Symbol("No added or removed packages"), "in $(pathrepr(manifest ? env.manifest_file : env.project_file))", ignore_indent) + printpkgstyle(io, Symbol("No packages added to or removed from"), "$(pathrepr(manifest ? env.manifest_file : env.project_file))", ignore_indent) else xs = !filter ? xs : eltype(xs)[(id, old, new) for (id, old, new) in xs if (id in uuids || something(new, old).name in names)] if isempty(xs) diff --git a/test/new.jl b/test/new.jl index 81394668ed..e447c46a99 100644 --- a/test/new.jl +++ b/test/new.jl @@ -2278,8 +2278,8 @@ end # Double add should not claim "Updating" Pkg.add(Pkg.PackageSpec(; name="Example", version="0.3.0"); io=io) output = String(take!(io)) - @test occursin(r"No added or removed packages to `.+Project\.toml`", output) - @test occursin(r"No added or removed packages to `.+Manifest\.toml`", output) + @test occursin(r"No packages added to or removed from `.+Project\.toml`", output) + @test occursin(r"No packages added to or removed from `.+Manifest\.toml`", output) # From tracking registry to tracking repo Pkg.add(Pkg.PackageSpec(; name="Example", rev="master"); io=io) output = String(take!(io)) @@ -2401,22 +2401,22 @@ end git_init_and_commit(projdir) ## empty project + empty diff Pkg.status(; io=io, diff=true) - @test occursin(r"No added or removed packages to `.+Project\.toml`", readline(io)) + @test occursin(r"No packages added to or removed from `.+Project\.toml`", readline(io)) Pkg.status(; io=io, mode=Pkg.PKGMODE_MANIFEST, diff=true) - @test occursin(r"No added or removed packages to `.+Manifest\.toml`", readline(io)) + @test occursin(r"No packages added to or removed from `.+Manifest\.toml`", readline(io)) ### empty diff + filter Pkg.status("Example"; io=io, diff=true) - @test occursin(r"No added or removed packages to `.+Project\.toml`", readline(io)) + @test occursin(r"No packages added to or removed from `.+Project\.toml`", readline(io)) ## non-empty project but empty diff Pkg.add("Markdown") git_init_and_commit(dirname(Pkg.project().path)) Pkg.status(; io=io, diff=true) - @test occursin(r"No added or removed packages to `.+Project\.toml`", readline(io)) + @test occursin(r"No packages added to or removed from `.+Project\.toml`", readline(io)) Pkg.status(; io=io, mode=Pkg.PKGMODE_MANIFEST, diff=true) - @test occursin(r"No added or removed packages to `.+Manifest\.toml`", readline(io)) + @test occursin(r"No packages added to or removed from `.+Manifest\.toml`", readline(io)) ### filter should still show "empty diff" Pkg.status("Example"; io=io, diff=true) - @test occursin(r"No added or removed packages to `.+Project\.toml`", readline(io)) + @test occursin(r"No packages added to or removed from `.+Project\.toml`", readline(io)) ## non-empty project + non-empty diff Pkg.rm("Markdown") Pkg.add(name="Example", version="0.3.0") diff --git a/test/resolve.jl b/test/resolve.jl index 07443b6d7d..f083d74e1a 100644 --- a/test/resolve.jl +++ b/test/resolve.jl @@ -740,8 +740,8 @@ end iob = IOBuffer() Pkg.resolve(io = iob) str = String(take!(iob)) - @test occursin(r"No added or removed packages to .*Project.toml", str) - @test occursin(r"No added or removed packages to .*Manifest.toml", str) + @test occursin(r"No packages added to or removed from .*Project.toml", str) + @test occursin(r"No packages added to or removed from .*Manifest.toml", str) end end