Compares the current version of a script with a previous revision. The output will appear in the viewer and only rows where there have been additions, deletions or modifications in the script will be shown.

diffPreviousRevisions(
  .file,
  .previous_revision,
  .current_revision = NULL,
  .side_by_side = TRUE,
  .ignore_white_space = FALSE,
  .display_entire_file = FALSE
)

Arguments

.file

file path from working directory

.previous_revision

revision to compare to current revision

.current_revision

current revision (defaults to local copy)

.side_by_side

Logical. Should diffs be displayed side by side?

.ignore_white_space

Logical. Should white space be ignored?

.display_entire_file

Logical. Should the entire file be displayed?

Examples

with_demoRepo({
 diffPreviousRevisions(.file = "script/data-assembly.R", 
                       .previous_revision = 2)
})
#> < data-assembly.R: Revision 2            > data-assembly.R: Local               
#> @@ 1,5 @@                                @@ 1,10 @@                             
#>   library(tidyverse)                       library(tidyverse)                   
#> ~                                        > source(here::here("script", "data-ass
#> ~                                        : embly", "da-functions.R"))           
#>   src_abc <- mrgda::read_src_dir(here::    src_abc <- mrgda::read_src_dir(here::
#>   here("data", "source", "STUDY-ABC"))     here("data", "source", "STUDY-ABC")) 
#>   derived <- list(sl = list(),tv = list    derived <- list(sl = list(),tv = list
#>   ())                                      ())                                  
#>   dm_0 <- src_abc$dm %>% filter(ACTARM     dm_0 <- src_abc$dm %>% filter(ACTARM 
#>   != "Screen Failure")                     != "Screen Failure")                 
#>   derived$sl$dm <- dm_0                    derived$sl$dm <- dm_0                
#> ~                                        > pk_0 <- src_abc$pc %>% filter(PCTEST 
#> ~                                        : == "TEST OF INTEREST")               
#> ~                                        > derived$tv$pc <- pk_0                
#> ~                                        > ex_1 <- src_abc$ex %>% filter(EXTRT =
#> ~                                        : = "DRUG OF INTEREST")                
#> ~                                        > derived$tv$dosing <- ex_1