Skip to content

Commit

Permalink
Pass rr setting as integer.
Browse files Browse the repository at this point in the history
  • Loading branch information
maleadt committed Jan 4, 2024
1 parent 406041e commit 8e4d932
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/PkgEvalCore.jl
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Default(val::T) where {T} = Setting{T}(val, false)
RRDisabled
end
Base.convert(::Type{RecordReplayMode}, x::Bool) = x ? RREnabled : RRDisabled
Base.convert(::Type{RecordReplayMode}, x::Int) = RecordReplayMode(x)

Base.@kwdef struct Configuration
name::String = "unnamed"
Expand Down Expand Up @@ -156,9 +157,15 @@ function Base.show(io::IO, cfg::Configuration)
print(io, "Configuration(")
got_fields = false
for field in fieldnames(Configuration)
if getproperty(cfg, field) != getproperty(default_cfg, field)
if ismodified(cfg, field)
got_fields && print(io, ", ")
print(io, field, "=", repr(getproperty(cfg, field)))
val = getproperty(cfg, field)
if val isa RecordReplayMode
# make sure we don't require the enum type, which may not be available
# globally (e.g. if PkgEval was loaded without importing all names)
val = Int(val)
end
print(io, field, "=", repr(val))
got_fields = true
end
end
Expand Down

0 comments on commit 8e4d932

Please sign in to comment.