aboutsummaryrefslogtreecommitdiffstats
path: root/src/ruleparser.cpp
diff options
context:
space:
mode:
authorThiago Macieira <thiago@cassini.local.lan>2007-12-24 11:28:41 -0200
committerThiago Macieira <thiago@cassini.local.lan>2007-12-24 11:28:41 -0200
commit5b8a1c0c71e75fd613fb1a27c61bdedf11803729 (patch)
tree21b60cfd2d66536b3219218693e176fba14fc295 /src/ruleparser.cpp
parentd91c2d9b90280decfafae66d4a72e735eeb1a125 (diff)
downloadsvn2git-5b8a1c0c71e75fd613fb1a27c61bdedf11803729.tar
svn2git-5b8a1c0c71e75fd613fb1a27c61bdedf11803729.tar.gz
svn2git-5b8a1c0c71e75fd613fb1a27c61bdedf11803729.tar.bz2
svn2git-5b8a1c0c71e75fd613fb1a27c61bdedf11803729.tar.xz
svn2git-5b8a1c0c71e75fd613fb1a27c61bdedf11803729.zip
Add support for min/max revision ranges
Diffstat (limited to 'src/ruleparser.cpp')
-rw-r--r--src/ruleparser.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/ruleparser.cpp b/src/ruleparser.cpp
index d0b3b76..c59b44b 100644
--- a/src/ruleparser.cpp
+++ b/src/ruleparser.cpp
@@ -49,10 +49,12 @@ void Rules::load()
// initialize the regexps we will use
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+(\\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;