diff options
author | Thiago Macieira <thiago@cassini.local.lan> | 2007-12-24 11:28:41 -0200 |
---|---|---|
committer | Thiago Macieira <thiago@cassini.local.lan> | 2007-12-24 11:28:41 -0200 |
commit | 5b8a1c0c71e75fd613fb1a27c61bdedf11803729 (patch) | |
tree | 21b60cfd2d66536b3219218693e176fba14fc295 /src/ruleparser.cpp | |
parent | d91c2d9b90280decfafae66d4a72e735eeb1a125 (diff) | |
download | svn2git-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.cpp | 8 |
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; |