diff options
author | Torgny Nyblom <kde@nyblom.org> | 2010-04-12 20:37:06 +0200 |
---|---|---|
committer | Torgny Nyblom <kde@nyblom.org> | 2010-04-12 20:37:06 +0200 |
commit | 70499909cc1dfed644aefbc9fa47eb7e8359dad1 (patch) | |
tree | 392c4dd9113041b32b74391087a879fbd58683d6 | |
parent | 260906c6675b71bcd890e761f23cb7c4a27ac7a8 (diff) | |
download | svn2git-70499909cc1dfed644aefbc9fa47eb7e8359dad1.tar svn2git-70499909cc1dfed644aefbc9fa47eb7e8359dad1.tar.gz svn2git-70499909cc1dfed644aefbc9fa47eb7e8359dad1.tar.bz2 svn2git-70499909cc1dfed644aefbc9fa47eb7e8359dad1.tar.xz svn2git-70499909cc1dfed644aefbc9fa47eb7e8359dad1.zip |
Fix logical error (deleted paths was ignored)
Improve the ruleparser so that prefix never starts or ends with a '/'
-rw-r--r-- | src/ruleparser.cpp | 4 | ||||
-rw-r--r-- | src/svn.cpp | 5 |
2 files changed, 7 insertions, 2 deletions
diff --git a/src/ruleparser.cpp b/src/ruleparser.cpp index 7ae9570..6e78efe 100644 --- a/src/ruleparser.cpp +++ b/src/ruleparser.cpp @@ -102,7 +102,9 @@ void Rules::load() } 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 ); + match.prefix = match.prefix.mid(1); + if( match.prefix.endsWith('/')) + match.prefix.chop(1); continue; } else if (matchActionLine.exactMatch(line)) { QString action = matchActionLine.cap(1); diff --git a/src/svn.cpp b/src/svn.cpp index 7a51ea7..5c79920 100644 --- a/src/svn.cpp +++ b/src/svn.cpp @@ -216,6 +216,9 @@ static void splitPathName(const Rules::Match &rule, const QString &pathName, QSt } if (path_p) { + QString path = pathName.mid(svnprefix.length()); + if( !path.isEmpty() && !rule.prefix.isEmpty() ) + path.prepend('/'); *path_p = rule.prefix + pathName.mid(svnprefix.length()); } } @@ -545,7 +548,7 @@ int SvnRevision::exportDispatch(const char *key, const svn_fs_path_change_t *cha apr_hash_t *changes, const QString ¤t, const Rules::Match &rule, apr_pool_t *pool) { - if(CommandLineParser::instance()->contains( QLatin1String("debug-rules")) && rule.action != Rules::Match::Ignore) + if(CommandLineParser::instance()->contains( QLatin1String("debug-rules"))) qDebug() << " " << qPrintable(current) << "matched rule:" << rule.lineNumber << "(" << rule.rx.pattern() << ")"; switch (rule.action) { case Rules::Match::Ignore: |