diff --git a/R/upgrade.R b/R/upgrade.R index 210748d83..1aa4427d5 100644 --- a/R/upgrade.R +++ b/R/upgrade.R @@ -3,12 +3,22 @@ #' #' @description #' Upgrade the version of renv associated with a project, including using -#' a development version from GitHub. Automatically snapshots the update +#' a development version from GitHub. Automatically snapshots the updated #' renv, updates the activate script, and restarts R. #' #' If you want to update all packages (including renv) to their latest CRAN #' versions, use [renv::update()]. #' +#' # Note +#' +#' `upgrade()` is expected to work for renv versions ≥1.0.1. +#' To upgrade from prior versions of renv, users should +#' +#' `renv::deactivate();` +#' `install.packages("renv");` +#' `renv::activate();` +#' `renv::record("renv")` +#' #' @inherit renv-params #' #' @param version The version of renv to be installed. @@ -111,7 +121,7 @@ renv_upgrade_impl <- function(project, version, reload, prompt) { # https://github.com/rstudio/renv/issues/2027 autoload <- config$autoloader.enabled() renv_scope_envvars(RENV_CONFIG_AUTOLOADER_ENABLED = autoload) - + code <- expr({ renv <- asNamespace("renv"); renv$summon() renv_infrastructure_write( diff --git a/man/upgrade.Rd b/man/upgrade.Rd index c806aeb55..8e701b499 100644 --- a/man/upgrade.Rd +++ b/man/upgrade.Rd @@ -32,12 +32,22 @@ called for its side effects. } \description{ Upgrade the version of renv associated with a project, including using -a development version from GitHub. Automatically snapshots the update +a development version from GitHub. Automatically snapshots the updated renv, updates the activate script, and restarts R. If you want to update all packages (including renv) to their latest CRAN versions, use \code{\link[=update]{update()}}. } +\section{Note}{ +\code{upgrade()} is expected to work for renv versions ≥1.0.1. +To upgrade from prior versions of renv, users should + +\code{renv::deactivate();} +\code{install.packages("renv");} +\code{renv::activate();} +\code{renv::record("renv")} +} + \examples{ \dontrun{