Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tweak wording to make "no changes" message more accurate #3806

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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 @@ -2276,7 +2276,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 @@ -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 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 @@ -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 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 @@ -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 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