Debian Codegraph @

man/history.Rd

raw
1 % Generated by roxygen2: do not edit by hand
2 % Please edit documentation in R/history.R
3 \name{history}
4 \alias{history}
5 \alias{revert}
6 \title{View and revert to a historical lockfile}
7 \usage{
8 history(project = NULL)
9
10 revert(commit = "HEAD", ..., project = NULL)
11 }
12 \arguments{
13 \item{project}{The project directory. If \code{NULL}, then the active project will
14 be used. If no project is currently active, then the current working
15 directory is used instead.}
16
17 \item{commit}{The commit associated with a prior version of the lockfile.}
18
19 \item{...}{Optional arguments; currently unused.}
20 }
21 \value{
22 \code{history()} returns a \code{data.frame} summarizing the commits in which
23 \code{renv.lock} has been changed. \code{revert()} is usually called for its
24 side-effect but also invisibly returns the \code{commit} used.
25 }
26 \description{
27 \code{history()} uses your version control system to show prior versions of the
28 lockfile and \code{revert()} allows you to restore one of them.
29
30 These functions are currently only implemented for projects that use git.
31 }
32 \examples{
33 \dontrun{
34
35 # get history of previous versions of renv.lock in VCS
36 db <- renv::history()
37
38 # choose an older commit
39 commit <- db$commit[5]
40
41 # revert to that version of the lockfile
42 renv::revert(commit = commit)
43
44 }
45 }