Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions src/recipes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
Revise.track(Base)
Revise.track(Core.Compiler)
Revise.track(stdlib)
Revise.track(PackageCompiledIntoSysimage)

Track updates to the code in Julia's `base` directory, `base/compiler`, or one of its
standard libraries.
Track updates to the code in Julia's `base` directory, `base/compiler`, one of its
standard libraries, or a package compiled into sysimage with PackageCompiler.jl.
"""
function track(mod::Module; modified_files=revision_queue)
id = PkgId(mod)
Expand Down Expand Up @@ -94,7 +95,14 @@ function _track(id, modname; modified_files=revision_queue)
track_subdir_from_git!(pkgdata, compilerdir; modified_files=modified_files)
# insertion into pkgdatas is done by track_subdir_from_git!
else
error("no Revise.track recipe for module ", modname)
pkgdata = watch_package(id)
modtime = mtime(Base.pkgorigins[id].cachepath)
Copy link
Owner

Choose a reason for hiding this comment

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

What happens if you do this?

julia> module EmptyModule end
Main.EmptyModule

julia> Revise.track(EmptyModule)
ERROR: no Revise.track recipe for module EmptyModule
Stacktrace:
 [1] error(::String, ::Symbol)
   @ Base ./error.jl:44
 [2] _track(id::Base.PkgId, modname::Symbol; modified_files::Set{Tuple{Revise.PkgData, String}})
   @ Revise ~/.julia/packages/Revise/VskYC/src/recipes.jl:97
 [3] #track#44
   @ ~/.julia/packages/Revise/VskYC/src/recipes.jl:12 [inlined]
 [4] track(mod::Module)
   @ Revise ~/.julia/packages/Revise/VskYC/src/recipes.jl:9
 [5] top-level scope
   @ REPL[2]:1

for rpath in srcfiles(pkgdata)
fullpath = joinpath(basedir(pkgdata), rpath)
if stat(fullpath).mtime > modtime
push!(modified_files, (pkgdata, rpath))
end
end
end
return nothing
end
Expand Down