Skip to content

Commit

Permalink
Tweak wording to make "no changes" message more accurate (#3806)
Browse files Browse the repository at this point in the history
* Tweak wording to make "no changes" message more accurate

* update tests/docs

* tweak version for new msg

* tweak message
  • Loading branch information
ericphanson authored Oct 13, 2024
1 parent 9e37e1b commit 27c1b1e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions docs/src/environments.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ 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
No Changes to `~/Example.jl/Project.toml`
No Changes 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.
Expand Down
2 changes: 1 addition & 1 deletion src/Operations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2614,7 +2614,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 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)
Expand Down
16 changes: 8 additions & 8 deletions test/new.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2291,8 +2291,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 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))
Expand Down Expand Up @@ -2415,22 +2415,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 packages added to or removed from `.+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 packages added to or removed from `.+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 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 Changes 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 Changes 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 Changes 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")
Expand Down
4 changes: 2 additions & 2 deletions test/resolve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -792,8 +792,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 packages added to or removed from .*Project.toml", str)
@test occursin(r"No packages added to or removed from .*Manifest.toml", str)
end
end

Expand Down

0 comments on commit 27c1b1e

Please sign in to comment.