aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColin Guthrie <colin@mageia.org>2014-05-24 17:19:02 +0100
committerColin Guthrie <colin@mageia.org>2014-05-24 17:19:02 +0100
commit6f26904232aadfc08f3c65c10b99867d908aae23 (patch)
treec9baa5da0f85d74ddda98066979376ed24fd5fbf
parentfb9c6dea4dd67433943a3769317b891a80817c29 (diff)
downloadsvn2git-6f26904232aadfc08f3c65c10b99867d908aae23.tar
svn2git-6f26904232aadfc08f3c65c10b99867d908aae23.tar.gz
svn2git-6f26904232aadfc08f3c65c10b99867d908aae23.tar.bz2
svn2git-6f26904232aadfc08f3c65c10b99867d908aae23.tar.xz
svn2git-6f26904232aadfc08f3c65c10b99867d908aae23.zip
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 :)
-rw-r--r--src/main.cpp16
1 files changed, 16 insertions, 0 deletions
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<int> 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<int> 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(".");