User reference
There are really only three functions that a user would be expected to call manually: revise, includet, and Revise.track. Other user-level constructs might apply if you want to debug Revise or prevent it from watching specific packages.
Revise.revise — Function.revise()eval any changes in the revision queue. See Revise.revision_queue.
revise(mod::Module)Reevaluate every definition in mod, whether it was changed or not. This is useful to propagate an updated macro definition, or to force recompiling generated functions.
Revise.track — Function.Revise.track(Base)
Revise.track(Core.Compiler)
Revise.track(stdlib)Track updates to the code in Julia's base directory, base/compiler, or one of its standard libraries.
Revise.track(mod::Module, file::AbstractString)
Revise.track(file::AbstractString)Watch file for updates and revise loaded code with any changes. mod is the module into which file is evaluated; if omitted, it defaults to Main.
If this produces many errors, check that you specified mod correctly.
Revise.includet — Function.includet(filename)Load filename and track any future changes to it. includet is essentially shorthand for
Revise.track(Main, filename; define=true, skip_include=false)includet is intended for "user scripts," e.g., a file you use locally for a specific purpose such as loading a specific data set or performing a particular analysis. Do not use includet for packages, as those should be handled by using or import. (If you're working with code in Base or one of Julia's standard libraries, use Revise.track(mod) instead, where mod is the module.) If using and import aren't working, you may have packages in a non-standard location; try fixing it with something like push!(LOAD_PATH, "/path/to/my/private/repos").
includet is deliberately non-recursive, so if filename loads any other files, they will not be automatically tracked. (See Revise.track to set it up manually.)
Revise logs (debugging Revise)
Revise.debug_logger — Function.logger = Revise.debug_logger(; min_level=Debug)Turn on debug logging (if min_level is set to Debug or better) and return the logger object. logger.logs contains a list of the logged events. The items in this list are of type Revise.LogRecord, with the following relevant fields:
group: the event category. Revise currently uses the following groups:- "Action": a change was implemented, of type described in the
messagefield. - "Parsing": a "significant" event in parsing. For these, examine the
messagefield for more information. - "Watching": an indication that Revise determined that a particular file needed to be examined for possible code changes. This is typically done on the basis of
mtime, the modification time of the file, and does not necessarily indicate that there were any changes.
- "Action": a change was implemented, of type described in the
message: a string containing more information. Some examples:- For entries in the "Action" group,
messagecan be"Eval"when modifying old methods or defining new ones, "DeleteMethod" when deleting a method, and "LineOffset" to indicate that the line offset for a method was updated (the last only affects the printing of stacktraces upon error, it does not change how code runs) - Items with group "Parsing" and message "Diff" contain sets
:newexprsand:oldexprsthat contain the expression unique to post- or pre-revision, respectively.
- For entries in the "Action" group,
kwargs: a pairs list of any other data. This is usually specific to particulargroup/messagecombinations.
See also Revise.actions and Revise.diffs.
Revise.actions — Function.actions(logger; line=false)Return a vector of all log events in the "Action" group. "LineOffset" events are returned only if line=true; by default the returned items are the events that modified methods in your session.
Revise.diffs — Function.diffs(logger)Return a vector of all log events that encode a (non-empty) diff between two versions of a file.
Prevent Revise from watching specific packages
Revise.dont_watch_pkgs — Constant.Revise.dont_watch_pkgsGlobal variable, use push!(Revise.dont_watch_pkgs, :MyPackage) to prevent Revise from tracking changes to MyPackage. You can do this from the REPL or from your .julia/config/startup.jl file.
See also Revise.silence.
Revise.silence — Function.Revise.silence(pkg)Silence warnings about not tracking changes to package pkg.