Skip to content

Commit

Permalink
Don't update registry when developing a local path, only when adding (#…
Browse files Browse the repository at this point in the history
…513)

or developing a non-local package, fix #512.
  • Loading branch information
fredrikekre authored and KristofferC committed Jul 27, 2018
1 parent d36c8ca commit 9015447
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 0 additions & 3 deletions stdlib/Pkg/src/API.jl
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ function add_or_develop(ctx::Context, pkgs::Vector{PackageSpec}; mode::Symbol, k
cmderror("Trying to $mode julia as a package")

ctx.preview && preview_info()
if !UPDATED_REGISTRY_THIS_SESSION[]
update_registry(ctx)
end
if mode == :develop
new_git = handle_repos_develop!(ctx, pkgs)
else
Expand Down
8 changes: 6 additions & 2 deletions stdlib/Pkg/src/Types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import REPL
using REPL.TerminalMenus

using ..TOML
import ..Pkg
import ..Pkg, ..UPDATED_REGISTRY_THIS_SESSION
import Pkg: GitTools, depots, logdir

import Base: SHA1
Expand Down Expand Up @@ -499,7 +499,9 @@ function handle_repos_develop!(ctx::Context, pkgs::AbstractVector{PackageSpec})
project_path = pkg.repo.url
parse_package!(ctx, pkg, project_path)
else
# We save the repo in case another environment wants to
# Only update the registry in case of developing a non-local package
UPDATED_REGISTRY_THIS_SESSION[] || Pkg.API.update_registry(ctx)
# We save the repo in case another environement wants to
# develop from the same repo, this avoids having to reclone it
# from scratch.
clone_path = joinpath(depots()[1], "clones")
Expand Down Expand Up @@ -567,6 +569,8 @@ function handle_repos_develop!(ctx::Context, pkgs::AbstractVector{PackageSpec})
end

function handle_repos_add!(ctx::Context, pkgs::AbstractVector{PackageSpec}; upgrade_or_add::Bool=true)
# Always update the registry when adding
UPDATED_REGISTRY_THIS_SESSION[] || Pkg.API.update_registry(ctx)
Base.shred!(LibGit2.CachedCredentials()) do creds
env = ctx.env
new_uuids = UUID[]
Expand Down

0 comments on commit 9015447

Please sign in to comment.