From 6f26904232aadfc08f3c65c10b99867d908aae23 Mon Sep 17 00:00:00 2001 From: Colin Guthrie Date: Sat, 24 May 2014 17:19:02 +0100 Subject: Add ability to skip specific revisions to the command line. We have a couple revisions we want to skip globally but due to our automatic repository creation approach and the large number of branches, we don't want to configure rules that setup this kind of skipping. This is a handy way to skip Pascal's great oops moment :) --- src/main.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index 225ae5a..a18c050 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -139,6 +139,7 @@ static const CommandLineOption options[] = { {"--commit-interval NUMBER", "if passed the cache will be flushed to git every NUMBER of commits"}, {"--stats", "after a run print some statistics about the rules"}, {"--svn-branches", "Use the contents of SVN when creating branches, Note: SVN tags are branches as well"}, + {"--skip-revisions REVISION[,REVISION]", "any svn revisions you want to completely ignore"}, {"-h, --help", "show help"}, {"-v, --version", "show version"}, CommandLineLastOption @@ -239,6 +240,14 @@ int main(int argc, char **argv) if (min_rev < resume_from) qDebug() << "skipping revisions" << min_rev << "to" << resume_from - 1 << "as requested"; + QSet skiprevs; + if (args->contains("skip-revisions")) { + foreach(const QString skiprev, args->optionArgument(QLatin1String("skip-revisions")).split(',')) { + skiprevs << skiprev.toInt(); + } + qDebug() << "skipping" << skiprevs.size() << "specific revisions as requested"; + } + if (resume_from) min_rev = resume_from; @@ -259,7 +268,14 @@ int main(int argc, char **argv) bool errors = false; QSet revisions = loadRevisionsFile(args->optionArgument(QLatin1String("revisions-file")), svn); const bool filerRevisions = !revisions.isEmpty(); + const bool skipRevisions = !skiprevs.isEmpty(); for (int i = min_rev; i <= max_rev; ++i) { + if(skipRevisions) { + if( skiprevs.contains(i) ) { + printf("Skipping revision %d\n", i); + continue; + } + } if(filerRevisions) { if( !revisions.contains(i) ) { printf("."); -- cgit v1.2.1