Skip to content

Commit

Permalink
Merge pull request #13953 from JuliaLang/tk/nogit
Browse files Browse the repository at this point in the history
Fix url(::Method) for no-git builds
  • Loading branch information
tkelman committed Nov 13, 2015
2 parents 8866b4e + 0f2f451 commit f045831
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
7 changes: 6 additions & 1 deletion base/methodshow.jl
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,12 @@ function url(m::Method)
line = m.func.code.line
line <= 0 || ismatch(r"In\[[0-9]+\]", file) && return ""
if inbase(M)
return "https://github.com/JuliaLang/julia/tree/$(Base.GIT_VERSION_INFO.commit)/base/$file#L$line"
if isempty(Base.GIT_VERSION_INFO.commit)
# this url will only work if we're on a tagged release
return "https://github.com/JuliaLang/julia/tree/v$VERSION/base/$file#L$line"
else
return "https://github.com/JuliaLang/julia/tree/$(Base.GIT_VERSION_INFO.commit)/base/$file#L$line"
end
else
try
d = dirname(file)
Expand Down
6 changes: 5 additions & 1 deletion test/show.jl
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,11 @@ end
@test contains(sprint(io -> writemime(io,"text/plain",methods(Base.inbase))),"inbase(m::Module)")
@test contains(sprint(io -> writemime(io,"text/html",methods(Base.inbase))),"inbase(m::<b>Module</b>)")

@test contains(Base.url(methods(eigs).defs),"https://github.com/JuliaLang/julia/tree/$(Base.GIT_VERSION_INFO.commit)/base/linalg/arnoldi.jl#L")
if isempty(Base.GIT_VERSION_INFO.commit)
@test contains(Base.url(methods(eigs).defs),"https://github.com/JuliaLang/julia/tree/v$VERSION/base/linalg/arnoldi.jl#L")
else
@test contains(Base.url(methods(eigs).defs),"https://github.com/JuliaLang/julia/tree/$(Base.GIT_VERSION_INFO.commit)/base/linalg/arnoldi.jl#L")
end

# print_matrix should be able to handle small and large objects easily, test by
# calling writemime. This also indirectly tests print_matrix_row, which
Expand Down

0 comments on commit f045831

Please sign in to comment.