This vignette provides detailed documentation and usage examples for the three main diff-related functions in the review package: svnLog(), diffPreviousRevisions(), and diffQced(). These functions facilitate the visual comparison of different versions of files within your SVN-managed project, aiding in quality control and code review processes.

Table of Contents

  • svnLog(): Retrieves revision history for a file
  • diffPreviousRevisions(): Compares two revisions of a file
  • diffQced(): Compares the latest version with the most recent QCed version

svnLog()

The svnLog() function returns the SVN revision history (revisions, authors, timestamps, and messages) for a specified file. This history is useful for comparing different versions of a file.

Usage

Retrieve Full Revision History
svnLog("script/data-assembly.R")

Output (Example):

rev author datetime msg
3 Bob 2025-01-15 10:00:00 Added new feature
2 Alice Johnson 2025-01-10 09:00:00 Modified data load
1 John Smith 2025-01-05 08:30:00 Initial commit

diffPreviousRevisions()

The diffPreviousRevisions() function visually identifies changes between two revisions of a file, highlighting additions, deletions, and modifications.

Usage

Compare with a Specific Previous Revision
diffPreviousRevisions(
  .file = "script/data-assembly.R",
  .previous_revision = 2,
  .side_by_side = FALSE
)
Output of diffPreviousVersions(): green text indicates modified code, red text indicates deleted code.
Output of diffPreviousVersions(): green text indicates modified code, red text indicates deleted code.

diffQced()

The diffQced() function identifies differences between the latest local version of a file and the most recent QCed revision, visually highlighting any changes that may need re-evaluation.

Usage

Compare with the Last QCed Revision
diffQced("script/data-assembly.R")

Output (Illustrative):

A rendered diff in your Viewer pane, highlighting lines added, removed, or changed since the last QCed revision.


Additional Notes

  • Customization: You can customize the display of diffs by adjusting parameters such as .side_by_side, .ignore_white_space, and .display_entire_file as needed.
  • SVN Updates: Always ensure your working copy is up to date (e.g., svn up) before comparing file revisions.