r-lib / devtools

Tools to make an R developer's life easier
https://devtools.r-lib.org
Other
2.4k stars 758 forks source link

devtools::install_svn automatically adds "trunk" to "url" path #1716

Closed mrustl closed 6 years ago

mrustl commented 6 years ago

Problem

devtools::install_svn() automatically adds "trunk" to the end of the url argument. However, in remotes::install_svn() this behavior is not happening (what I would expect).

Example

Fails (because "trunk" is added by an devtools functions)

devtools::install_svn("http://our_company_repo/R_Development/trunk/RPackages/kwb.utils")

Warning message: running command '"C:\PROGRA~1\TORTOI~1\bin\svn.exe" info --xml http://our_company_repo/R_Development/trunk/RPackages/kwb.utils/trunk'

Works

remotes::install_svn("http://our_company_repo/R_Development/trunk/RPackages/kwb.utils")

Downloading svn repo http://our_company_repo/R_Development/trunk/RPackages/kwb.utils "C:\PROGRA~1\TORTOI~1\bin\svn.exe" export http://our_company_repo/R_Development/trunk/RPackages/kwb.utils C:\Users\myname\AppData\Local\Temp\RtmpaSkADw\file38d027ad216c

Environment

This happens in both the latest CRAN version of devtools and the current Github development version

devtools::session_info()

Session info ------------------------------- setting value
version R version 3.4.3 (2017-11-30) system i386, mingw32
ui RStudio (1.1.423)
language (EN)
collate English_United Kingdom.1252 tz Europe/Berlin
date 2018-02-23

Packages ------------------------------------------------------------------ devtools 1.13.5 2018-02-18 CRAN (R 3.4.3) devtools 1.13.5.9000 2018-02-23 Github (r-lib/devtools@c890eaf)
remotes 1.1.1 2017-12-20 CRAN (R 3.4.3)

jimhester commented 6 years ago

This has been fixed in the devel devtools for a long time 328ebe0e8c9c257044b26332d812a84ca764f557. I am guessing when you tried it devel devtools was actually still loaded (perhaps you did not restart R after installing it).

mrustl commented 6 years ago

You are right that the problem is solved in the latest development version of devtools (r-lib/devtools@3068e65).

However, in the latest CRAN version (1.13.5) the outdated wrong function devtools:::full_svn_url is used (restarted R multiple times):

full_svn_url <- function (x) { if (!is.null(x$branch)) { url <- file.path(x$url, "branches", x$branch) } else { url <- file.path(x$url, "trunk") } if (!is.null(x$svn_subdir)) { url <- file.path(url, x$svn_subdir) } url }

But the problem only occurs in case of devtools::install_svn("http://repos_path") but not in case of devtools::install_svn("https://github.com/r-lib/devtools.git"). Anyway, in the next release the fix should be hopefully also on CRAN.

gaborcsardi commented 6 years ago

I think this has been fixed in the remotes package as well, if you need something on CRAN now.

mrustl commented 6 years ago

Yes the remotes package on CRAN works properly. However, the RStudio "Build" button works using the devtools package in the background right?

gaborcsardi commented 6 years ago

Yeah, if you need to install from svn during build, e.g. via the Remotes field, then I am afraid you cannot use remotes.

lock[bot] commented 6 years ago

This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/