Skip to content

Commit

Permalink
fix some printing inconsistencies (#272)
Browse files Browse the repository at this point in the history
* fix some printing inconsistencies
  • Loading branch information
KristofferC committed May 9, 2018
1 parent 24376f8 commit 162c025
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 4 additions & 3 deletions stdlib/Pkg3/src/Display.jl
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,12 @@ vstring(ctx::Context, a::VerInfo) =
)

Base.:(==)(a::VerInfo, b::VerInfo) =
a.hash == b.hash && a.ver == b.ver && a.pinned == b.pinned
a.hash == b.hash && a.ver == b.ver && a.pinned == b.pinned && a.repo == b.repo

(a::VerInfo, b::VerInfo) = a.hash == b.hash &&
(a.ver == nothing || b.ver == nothing || a.ver == b.ver) &&
(a.pinned == b.pinned)
(a.pinned == b.pinned) &&
(a.repo == nothing || b.repo == nothing || a.repo == b.repo)

struct DiffEntry
uuid::UUID
Expand Down Expand Up @@ -154,7 +155,7 @@ function print_diff(io::IO, ctx::Context, diff::Vector{DiffEntry})
"versions match but hashes don't: $(x.old.hash)$(x.new.hash)"
push!(warnings, msg)
end
vstr = (x.old.ver == x.new.ver && x.old.pinned == x.new.pinned) ?
vstr = (x.old.ver == x.new.ver && x.old.pinned == x.new.pinned && x.old.repo == x.new.repo) ?
vstring(ctx, x.new) :
vstring(ctx, x.old) * "" * vstring(ctx, x.new)
end
Expand Down
1 change: 1 addition & 0 deletions stdlib/Pkg3/src/Types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,7 @@ end

GitRepo(url::String, revspec) = GitRepo(url, revspec, nothing)
GitRepo(url::String) = GitRepo(url, "", nothing)
Base.:(==)(repo1::GitRepo, repo2::GitRepo) = (repo1.url == repo2.url && repo1.rev == repo2.rev && repo1.git_tree_sha1 == repo2.git_tree_sha1)

mutable struct PackageSpec
name::String
Expand Down

0 comments on commit 162c025

Please sign in to comment.