Created
September 6, 2015 16:46
-
-
Save jimhester/0f8ccb24c753cb0c0d05 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(xml2) | |
date <- "2015-04-17" | |
tmp <- tempfile() | |
system2("svn", | |
args = c("log", | |
"-r", sprintf("{%s}:HEAD", date), | |
"--xml", | |
"-v"), | |
stdout = tmp) | |
commits <- read_xml(tmp) | |
unlink(tmp) | |
# number of total commits | |
xml_length(commits) | |
# files touched for each commit | |
files <- lapply(as_list(xml_children(commits)), | |
function(x) xml_text(xml_find_all(x, ".//path[@kind='file']"))) | |
# packages changed for each commit | |
packages <- lapply(files, function(x) | |
unique(gsub(x, | |
pattern = "/trunk/madman/Rpacks/([^/]+).*", | |
replacement = "\\1"))) | |
# commits per package | |
table(unlist(packages)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment