Skip to content

Commit

Permalink
Add export option to @deprecate
Browse files Browse the repository at this point in the history
  • Loading branch information
simonbyrne committed Jan 20, 2017
1 parent 826bab2 commit 4a1e17a
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions base/deprecated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
# the name of the function, which is used to ensure that the deprecation warning
# is only printed the first time for each call place.

macro deprecate(old,new)
macro deprecate(old,new,ex=true)
meta = Expr(:meta, :noinline)
if isa(old,Symbol)
oldname = Expr(:quote,old)
newname = Expr(:quote,new)
Expr(:toplevel,
Expr(:export,esc(old)),
ex ? Expr(:export,esc(old)) : nothing,
:(function $(esc(old))(args...)
$meta
depwarn(string($oldname," is deprecated, use ",$newname," instead."),
Expand Down Expand Up @@ -1765,11 +1765,11 @@ end

# limit use of LibGit2.get method (part of #19839)
eval(Base.LibGit2, quote
@deprecate get{T<:GitObject}(::Type{T}, repo::GitRepo, x) T(repo, x)
@deprecate get{T<:GitObject}(::Type{T}, repo::GitRepo, oid::GitHash, oid_size::Int) T(repo, GitShortHash(oid, oid_size))
@deprecate revparse(repo::GitRepo, objname::AbstractString) GitObject(repo, objname)
@deprecate object(repo::GitRepo, te::GitTreeEntry) GitObject(repo, te)
@deprecate commit(ann::GitAnnotated) GitHash(ann)
@deprecate get{T<:GitObject}(::Type{T}, repo::GitRepo, x) T(repo, x) false
@deprecate get{T<:GitObject}(::Type{T}, repo::GitRepo, oid::GitHash, oid_size::Int) T(repo, GitShortHash(oid, oid_size)) false
@deprecate revparse(repo::GitRepo, objname::AbstractString) GitObject(repo, objname) false
@deprecate object(repo::GitRepo, te::GitTreeEntry) GitObject(repo, te) false
@deprecate commit(ann::GitAnnotated) GitHash(ann) false
end)

# End deprecations scheduled for 0.6

0 comments on commit 4a1e17a

Please sign in to comment.