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;
} 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;
match = Match();
match.rx = QRegExp(matchLine.cap(1), Qt::CaseSensitive, QRegExp::RegExp2);
} else {
- qWarning() << "Malformed line in configure file:" << origLine;
- state = ReadingNone;
+ qFatal("Malformed line in rules file: %s", qPrintable(origLine));
}
}
}