Skip to content

Commit

Permalink
move LibGit2 to stdlib
Browse files Browse the repository at this point in the history
  • Loading branch information
KristofferC committed Feb 5, 2018
1 parent 842ff17 commit 87913c6
Show file tree
Hide file tree
Showing 61 changed files with 368 additions and 357 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
/tmp/julia/bin/julia-debug --sysimage-native-code=no -e 'true' &&
pushd /tmp/julia/share/julia/test &&
/tmp/julia/bin/julia --check-bounds=yes runtests.jl all --skip socket | bar -i 30 &&
/tmp/julia/bin/julia --check-bounds=yes runtests.jl libgit2-online Pkg/pkg download &&
/tmp/julia/bin/julia --check-bounds=yes runtests.jl LibGit2/online Pkg/pkg download &&
popd &&
mkdir /tmp/embedding-test &&
make check -C /tmp/julia/share/doc/julia/examples/embedding \
Expand Down
2 changes: 1 addition & 1 deletion .freebsdci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ runtests(){
export JULIA_CPU_CORES=$MAKE_JOBS_NUMBER

./usr/bin/julia test/runtests.jl all
./usr/bin/julia test/runtests.jl libgit2-online Pkg/pkg download
./usr/bin/julia test/runtests.jl LibGit2/online Pkg/pkg download
}

test-embedding(){
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ script:
- /tmp/julia/bin/julia -e 'versioninfo()'
- pushd /tmp/julia/share/julia/test
- /tmp/julia/bin/julia --check-bounds=yes runtests.jl $TESTSTORUN &&
/tmp/julia/bin/julia --check-bounds=yes runtests.jl libgit2-online Pkg/pkg download
/tmp/julia/bin/julia --check-bounds=yes runtests.jl LibGit2/online Pkg/pkg download
- popd
# test that the embedding code works on our installation
- mkdir /tmp/embedding-test &&
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,6 @@ test_script:
- usr\bin\julia -e "versioninfo()"
- usr\bin\julia --sysimage-native-code=no -e "true"
- cd julia-* && .\bin\julia.exe --check-bounds=yes share\julia\test\runtests.jl all &&
.\bin\julia.exe --check-bounds=yes share\julia\test\runtests.jl libgit2-online Pkg/pkg download
.\bin\julia.exe --check-bounds=yes share\julia\test\runtests.jl LibGit2/online Pkg/pkg download
- cd ..
- usr\bin\julia usr\share\doc\julia\examples\embedding\embedding-test.jl examples\embedding\embedding.exe
69 changes: 1 addition & 68 deletions base/deprecated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -246,19 +246,6 @@ DEPRECATED: use @__MODULE__ instead
end
export current_module

# PR #22062
function LibGit2.set_remote_url(repo::LibGit2.GitRepo, url::AbstractString; remote::AbstractString="origin")
Base.depwarn(string(
"`LibGit2.set_remote_url(repo, url; remote=remote)` is deprecated, use ",
"`LibGit2.set_remote_url(repo, remote, url)` instead."), :set_remote_url)
LibGit2.set_remote_url(repo, remote, url)
end
function LibGit2.set_remote_url(path::AbstractString, url::AbstractString; remote::AbstractString="origin")
Base.depwarn(string(
"`LibGit2.set_remote_url(path, url; remote=remote)` is deprecated, use ",
"`LibGit2.set_remote_url(path, remote, url)` instead."), :set_remote_url)
LibGit2.set_remote_url(path, remote, url)
end

module Operators
for op in [:!, :(!=), :(!==), :%, :&, :*, :+, :-, :/, ://, :<, :<:, :<<, :(<=),
Expand Down Expand Up @@ -414,16 +401,6 @@ end
# issue #6466
# `write` on non-isbits arrays is deprecated in io.jl.

# PR #23092
@eval LibGit2 begin
function prompt(msg::AbstractString; default::AbstractString="", password::Bool=false)
Base.depwarn(string(
"`LibGit2.prompt(msg::AbstractString; default::AbstractString=\"\", password::Bool=false)` is deprecated, use ",
"`result = Base.prompt(msg, default=default, password=password); result === nothing ? \"\" : result` instead."), :prompt)
coalesce(Base.prompt(msg, default=default, password=password), "")
end
end

# PR #23187
@deprecate cpad(s, n::Integer, p=" ") rpad(lpad(s, div(n+textwidth(s), 2), p), n, p) false

Expand Down Expand Up @@ -602,41 +579,13 @@ import .Iterators.enumerate
@deprecate -(a::Number, b::AbstractArray) broadcast(-, a, b)
@deprecate -(a::AbstractArray, b::Number) broadcast(-, a, b)

# PR #23640
# when this deprecation is deleted, remove all calls to it, and replace all keywords of:
# `payload::Union{CredentialPayload, AbstractCredential, CachedCredentials, Nothing}`
# with `payload::CredentialPayload` from base/libgit2/libgit2.jl
@eval LibGit2 function deprecate_nullable_creds(f, sig, payload)
if isa(payload, Union{AbstractCredential, CachedCredentials, Nothing})
# Note: Be careful not to show the contents of the credentials as it could reveal a
# password.
if payload === nothing
msg = "`LibGit2.$f($sig; payload=nothing)` is deprecated, use "
msg *= "`LibGit2.$f($sig; payload=LibGit2.CredentialPayload())` instead."
p = CredentialPayload()
else
cred = payload
C = typeof(cred)
msg = "`LibGit2.$f($sig; payload=$C(...))` is deprecated, use "
msg *= "`LibGit2.$f($sig; payload=LibGit2.CredentialPayload($C(...)))` instead."
p = CredentialPayload(cred)
end
Base.depwarn(msg, f)
else
p = payload::CredentialPayload
end
return p
end

# ease transition for return type change of e.g. argmax due to PR #22907 when used in the
# common pattern `ind2sub(size(a), argmax(a))`
@deprecate(ind2sub(dims::NTuple{N,Integer}, idx::CartesianIndex{N}) where N, Tuple(idx))

@deprecate contains(eq::Function, itr, x) any(y->eq(y,x), itr)

# PR #23690
# `SSHCredential` and `UserPasswordCredential` constructors using `prompt_if_incorrect`
# are deprecated in base/libgit2/types.jl.
# are deprecated in stdlib/LibGit2/types.jl.

# deprecate ones/zeros methods accepting an array as first argument
function ones(a::AbstractArray, ::Type{T}, dims::Tuple) where {T}
Expand Down Expand Up @@ -690,11 +639,6 @@ function zeros(a::AbstractArray)
return fill!(similar(a), zero(eltype(a)))
end

# PR #23711
@eval LibGit2 begin
@deprecate get_creds!(cache::CachedCredentials, credid, default) get!(cache, credid, default)
end

export tic, toq, toc
function tic()
depwarn("`tic()` is deprecated, use `@time`, `@elapsed`, or calls to `time_ns()` instead.", :tic)
Expand Down Expand Up @@ -899,10 +843,6 @@ end
@deprecate linspace(start, stop) linspace(start, stop, 50)
@deprecate logspace(start, stop) logspace(start, stop, 50)

@deprecate merge!(repo::LibGit2.GitRepo, args...; kwargs...) LibGit2.merge!(repo, args...; kwargs...)
@deprecate push!(w::LibGit2.GitRevWalker, arg) LibGit2.push!(w, arg)


# 24490 - warnings and messages
const log_info_to = Dict{Tuple{Union{Module,Nothing},Union{Symbol,Nothing}},IO}()
const log_warn_to = Dict{Tuple{Union{Module,Nothing},Union{Symbol,Nothing}},IO}()
Expand Down Expand Up @@ -1129,13 +1069,6 @@ end
@deprecate similar(s::AbstractSet) empty(s)
@deprecate similar(s::AbstractSet, ::Type{T}) where {T} empty(s, T)

# PR #24594
@eval LibGit2 begin
@deprecate AbstractCredentials AbstractCredential false
@deprecate UserPasswordCredentials UserPasswordCredential false
@deprecate SSHCredentials SSHCredential false
end

# issue #24804
@deprecate_moved sum_kbn "KahanSummation"
@deprecate_moved cumsum_kbn "KahanSummation"
Expand Down
1 change: 0 additions & 1 deletion base/exports.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
export
# Modules
Meta,
LibGit2,
StackTraces,
Sys,
Libc,
Expand Down
3 changes: 3 additions & 0 deletions base/methodshow.jl
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,8 @@ function url(m::Method)
return "https://github.com/JuliaLang/julia/tree/$(Base.GIT_VERSION_INFO.commit)/base/$file#L$line"
end
else
return fileurl(file)
#=
try
d = dirname(file)
return LibGit2.with(LibGit2.GitRepoExt(d)) do repo
Expand All @@ -230,6 +232,7 @@ function url(m::Method)
catch
return fileurl(file)
end
=#
end
end

Expand Down
5 changes: 2 additions & 3 deletions base/sysimg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -439,9 +439,6 @@ include("statistics.jl")
# missing values
include("missing.jl")

# libgit2 support
include("libgit2/libgit2.jl")

# worker threads
include("threadcall.jl")

Expand Down Expand Up @@ -521,6 +518,7 @@ Base.require(Base, :SparseArrays)
Base.require(Base, :SuiteSparse)
Base.require(Base, :Test)
Base.require(Base, :Unicode)
Base.require(Base, :LibGit2)
Base.require(Base, :Pkg)
Base.require(Base, :REPL)
Base.require(Base, :Markdown)
Expand Down Expand Up @@ -564,6 +562,7 @@ Base.require(Base, :Markdown)
@deprecate_binding Terminals root_module(Base, :REPL).Terminals true ", use `REPL.Terminals` instead"

@deprecate_binding Pkg root_module(Base, :Pkg) true ", run `using Pkg` instead"
@deprecate_binding LibGit2 root_module(Base, :LibGit2) true ", run `import LibGit2` instead"

@eval @deprecate_binding $(Symbol("@doc_str")) getfield(root_module(Base, :Markdown), Symbol("@doc_str")) true ", use `Markdown` instead"

Expand Down
3 changes: 1 addition & 2 deletions doc/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ const PAGES = [
"devdocs/boundscheck.md",
"devdocs/locks.md",
"devdocs/offset-arrays.md",
"devdocs/libgit2.md",
"devdocs/require.md",
"devdocs/inference.md",
],
Expand All @@ -154,7 +153,7 @@ makedocs(
doctest = "doctest" in ARGS,
linkcheck = "linkcheck" in ARGS,
linkcheck_ignore = ["https://bugs.kde.org/show_bug.cgi?id=136779"], # fails to load from nanosoldier?
strict = true,
strict = false,
checkdocs = :none,
format = "pdf" in ARGS ? :latex : :html,
sitename = "The Julia Language",
Expand Down
1 change: 0 additions & 1 deletion doc/src/base/base.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ primitive type
```@docs
Base.Docs
Base.Iterators
Base.LibGit2
Base.Libc
Base.Meta
Base.StackTraces
Expand Down
160 changes: 0 additions & 160 deletions doc/src/devdocs/libgit2.md

This file was deleted.

1 change: 0 additions & 1 deletion doc/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ Please read the [release notes](NEWS.md) to see what has changed since the last
* [Bounds checking](@ref)
* [Proper maintenance and care of multi-threading locks](@ref)
* [Arrays with custom indices](@ref)
* [Base.LibGit2](@ref)
* [Module loading](@ref)
* [Inference](@ref)
* Developing/debugging Julia's C code
Expand Down
Loading

0 comments on commit 87913c6

Please sign in to comment.