Skip to content

Commit

Permalink
Merge pull request #24837 from JuliaLang/rf/push-push!
Browse files Browse the repository at this point in the history
push Base.push! and LibGit2.push! apart
  • Loading branch information
StefanKarpinski authored Jan 21, 2018
2 parents c546f03 + 40abb0b commit 324dc49
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 10 deletions.
2 changes: 2 additions & 0 deletions base/deprecated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -998,6 +998,8 @@ end
@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}()
Expand Down
2 changes: 1 addition & 1 deletion base/libgit2/callbacks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ end
function fetchhead_foreach_callback(ref_name::Cstring, remote_url::Cstring,
oid_ptr::Ptr{GitHash}, is_merge::Cuint, payload::Ptr{Cvoid})
fhead_vec = unsafe_pointer_to_objref(payload)::Vector{FetchHead}
push!(fhead_vec, FetchHead(unsafe_string(ref_name), unsafe_string(remote_url),
Base.push!(fhead_vec, FetchHead(unsafe_string(ref_name), unsafe_string(remote_url),
unsafe_load(oid_ptr), is_merge == 1))
return Cint(0)
end
Expand Down
4 changes: 2 additions & 2 deletions base/libgit2/commit.jl
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ function commit(repo::GitRepo, msg::AbstractString;
# Retrieve parents from HEAD
if isempty(parent_ids)
try # if throws then HEAD not found -> empty repo
push!(parent_ids, GitHash(repo, refname))
Base.push!(parent_ids, GitHash(repo, refname))
end
end

Expand All @@ -127,7 +127,7 @@ function commit(repo::GitRepo, msg::AbstractString;
parents = GitCommit[]
try
for id in parent_ids
push!(parents, GitCommit(repo, id))
Base.push!(parents, GitCommit(repo, id))
end
commit_id = commit(repo, refname, msg, auth_sig, comm_sig, tree, parents...)
finally
Expand Down
2 changes: 1 addition & 1 deletion base/libgit2/gitcredential.jl
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ function credential_helpers(cfg::GitConfig, cred::GitCredential)
return GitCredentialHelper[]
end

push!(helpers, parse(GitCredentialHelper, value))
Base.push!(helpers, parse(GitCredentialHelper, value))
end

return helpers
Expand Down
2 changes: 1 addition & 1 deletion base/libgit2/libgit2.jl
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ function diff_files(repo::GitRepo, branch1::AbstractString, branch2::AbstractStr
delta = diff[i]
delta === nothing && break
if Consts.DELTA_STATUS(delta.status) in filter
push!(files, unsafe_string(delta.new_file.path))
Base.push!(files, unsafe_string(delta.new_file.path))
end
end
close(diff)
Expand Down
2 changes: 1 addition & 1 deletion base/libgit2/reference.jl
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ function Base.map(f::Function, bi::GitBranchIter)
if res === nothing
res = Vector{typeof(val)}()
end
push!(res, val)
Base.push!(res, val)
val, s = next(bi, s)
end
return res
Expand Down
2 changes: 1 addition & 1 deletion base/libgit2/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ function features()
feat = ccall((:git_libgit2_features, :libgit2), Cint, ())
res = Consts.GIT_FEATURE[]
for f in instances(Consts.GIT_FEATURE)
isset(feat, Cuint(f)) && push!(res, f)
isset(feat, Cuint(f)) && Base.push!(res, f)
end
return res
end
Expand Down
6 changes: 3 additions & 3 deletions base/libgit2/walker.jl
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@ Start the [`GitRevWalker`](@ref) `walker` at commit `cid`. This function can be
to apply a function to all commits since a certain year, by passing the first commit
of that year as `cid` and then passing the resulting `w` to [`map`](@ref LibGit2.map).
"""
function Base.push!(w::GitRevWalker, cid::GitHash)
function push!(w::GitRevWalker, cid::GitHash)
@check ccall((:git_revwalk_push, :libgit2), Cint, (Ptr{Cvoid}, Ptr{GitHash}), w.ptr, Ref(cid))
return w
end

function Base.push!(w::GitRevWalker, range::AbstractString)
function push!(w::GitRevWalker, range::AbstractString)
@check ccall((:git_revwalk_push_range, :libgit2), Cint, (Ptr{Cvoid}, Ptr{UInt8}), w.ptr, range)
return w
end
Expand Down Expand Up @@ -126,7 +126,7 @@ function Base.map(f::Function, walker::GitRevWalker;
repo = repository(walker)
while !done(walker, s)
val = f(s[1], repo)
push!(res, val)
Base.push!(res, val)
val, s = next(walker, s)
c +=1
count == c && break
Expand Down

1 comment on commit 324dc49

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Executing the daily benchmark build, I will reply here when finished:

@nanosoldier runbenchmarks(ALL, isdaily = true)

Please sign in to comment.