force_push: Force push a tracked environment to a given commit.

Description Usage Arguments Examples

Description

Forcing pushing means restoring a tracked environment to what it looked like as of that commit. You can force push with either the commit index or the name of the commit.

Usage

1

Arguments

env

tracked_environment.

commit

integer or character. If character, the commit with this name will be attempted for the force push. If there are multiple commits with this same name, a warning will be issued.

Examples

1
2
3
4
5
6
7
env <- tracked_environment()
env$x <- 1
commit(env) <- 'first commit'
env$y <- 2
commit(env) <- 'second commit'
force_push(env, 'first commit') # equivalent to force_push(env, 1)
stopifnot(identical(as.list(environment(env)), list(x = 1)))

robertzk/objectdiff documentation built on May 27, 2019, 10:35 a.m.