From 5b8a1c0c71e75fd613fb1a27c61bdedf11803729 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 24 Dec 2007 11:28:41 -0200 Subject: Add support for min/max revision ranges --- src/ruleparser.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/ruleparser.cpp') 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; -- cgit v1.2.1