]> andersk Git - svn-all-fast-export.git/blobdiff - src/ruleparser.cpp
Add support for min/max revision ranges
[svn-all-fast-export.git] / src / ruleparser.cpp
index c214440484c192b80cfec75f0acf69f15a50fdcd..c59b44b0f64997a3202917fc450a4fbdf8e0c22a 100644 (file)
@@ -47,12 +47,14 @@ void Rules::load()
         return;
 
     // initialize the regexps we will use
-    QRegExp repoLine("create repository\\s+(\\w+)", Qt::CaseInsensitive);
+    QRegExp repoLine("create repository\\s+(\\S+)", Qt::CaseInsensitive);
     QRegExp repoBranchLine("branch\\s+(\\S+)\\s+from\\s+(\\S+)", Qt::CaseInsensitive);
+
     QRegExp matchLine("match\\s+(.*)", Qt::CaseInsensitive);
-    QRegExp matchRepoLine("repository\\s+(\\w+)", Qt::CaseInsensitive);
+    QRegExp matchRepoLine("repository\\s+(\\S+)", Qt::CaseInsensitive);
     QRegExp matchBranchLine("branch\\s+(\\S+)", Qt::CaseInsensitive);
     QRegExp matchPathLine("path\\s+(.*)", Qt::CaseInsensitive);
+    QRegExp matchRevLine("(min|max) revision (\\d+)", Qt::CaseInsensitive);
 
     QTextStream s(&file);
     enum { ReadingNone, ReadingRepository, ReadingMatch } state = ReadingNone;
@@ -92,6 +94,12 @@ void Rules::load()
             } else if (matchPathLine.exactMatch(line)) {
                 match.path = matchPathLine.cap(1);
                 continue;
+            } else if (matchRevLine.exactMatch(line)) {
+                if (matchRevLine.cap(1) == "min")
+                    match.minRevision = matchRevLine.cap(2).toInt();
+                else            // must be max
+                    match.maxRevision = matchRevLine.cap(2).toInt();
+                continue;
             } else if (line == "end match") {
                 m_matchRules += match;
                 state = ReadingNone;
This page took 0.027036 seconds and 4 git commands to generate.