From 260906c6675b71bcd890e761f23cb7c4a27ac7a8 Mon Sep 17 00:00:00 2001 From: Torgny Nyblom Date: Mon, 12 Apr 2010 16:58:22 +0200 Subject: Ditch the Rootdir option and add a prefix one instead (Thiago is always correct :)) --- src/ruleparser.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/ruleparser.cpp') diff --git a/src/ruleparser.cpp b/src/ruleparser.cpp index c9279ac..7ae9570 100644 --- a/src/ruleparser.cpp +++ b/src/ruleparser.cpp @@ -55,7 +55,7 @@ void Rules::load() QRegExp matchBranchLine("branch\\s+(\\S+)", Qt::CaseInsensitive); QRegExp matchRevLine("(min|max) revision (\\d+)", Qt::CaseInsensitive); QRegExp matchAnnotateLine("annotated\\s+(\\S+)", Qt::CaseInsensitive); - QRegExp matchRootDirLine("rootdir\\s+(\\S+)", Qt::CaseInsensitive); + QRegExp matchPrefixLine("prefix\\s+(\\S+)", Qt::CaseInsensitive); QTextStream s(&file); enum { ReadingNone, ReadingRepository, ReadingMatch } state = ReadingNone; @@ -99,8 +99,10 @@ void Rules::load() else // must be max match.maxRevision = matchRevLine.cap(2).toInt(); continue; - } else if (matchRootDirLine.exactMatch(line)) { - match.rootdir = QRegExp(matchRootDirLine.cap(1), Qt::CaseSensitive, QRegExp::RegExp2); + } else if (matchPrefixLine.exactMatch(line)) { + match.prefix = matchPrefixLine.cap(1); + if( match.prefix.startsWith('/')) + qFatal("Prefix starts with \"/\" on line %d, this can cause git-fast-import to crach.", lineNumber ); continue; } else if (matchActionLine.exactMatch(line)) { QString action = matchActionLine.cap(1); -- cgit v1.2.1