
Push a validated spec_ir snapshot onto a spec_history stack
Source: R/spec-history.R
history_push.RdIgnores no-op pushes whose semantic diff against the current snapshot is
empty. Truncates any redo branch above the current pointer and trims oldest
entries if the stack exceeds max_entries.
Arguments
- hist
A
spec_historyobject created byspec_history().- spec
A validated
spec_irobject.- label
Optional character description of the edit (defaults to
format_diff_summary()).
Examples
h <- spec_history(new_spec_ir())
s2 <- new_spec_ir(hierarchy = list(levels = 1L, n_obs = 300L))
history_push(h, s2, label = "N = 300")
history_summary(h)
#> index is_current label n_changes
#> 1 1 FALSE Initial specification 0
#> 2 2 TRUE N = 300 1