diff options
author | Thiago Macieira <thiago@cassini.local.lan> | 2007-12-24 11:45:45 -0200 |
---|---|---|
committer | Thiago Macieira <thiago@cassini.local.lan> | 2007-12-24 11:45:45 -0200 |
commit | 5539acb42d1b0b9a9f9b6c8153c1b821a0311d16 (patch) | |
tree | d9a2920621dabbef89b2677c11f5c8c4d7c794f4 | |
parent | 3ffa3592fdcb7fbde29e84f8f72050ba2868e0e4 (diff) | |
download | svn2git-5539acb42d1b0b9a9f9b6c8153c1b821a0311d16.tar svn2git-5539acb42d1b0b9a9f9b6c8153c1b821a0311d16.tar.gz svn2git-5539acb42d1b0b9a9f9b6c8153c1b821a0311d16.tar.bz2 svn2git-5539acb42d1b0b9a9f9b6c8153c1b821a0311d16.tar.xz svn2git-5539acb42d1b0b9a9f9b6c8153c1b821a0311d16.zip |
Detect whether a file deletion was a directory
-rw-r--r-- | src/svn.cpp | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/src/svn.cpp b/src/svn.cpp index 9cb0b98..6333877 100644 --- a/src/svn.cpp +++ b/src/svn.cpp @@ -250,6 +250,20 @@ static int recursiveDumpDir(Repository::Transaction *txn, svn_fs_root_t *fs_root } } +static bool wasDir(svn_fs_t *fs, int revnum, const char *pathname, apr_pool_t *pool) +{ + AprAutoPool subpool(pool); + svn_fs_root_t *fs_root; + if (svn_fs_revision_root(&fs_root, fs, revnum, subpool) != SVN_NO_ERROR) + return false; + + svn_boolean_t is_dir; + if (svn_fs_is_dir(&is_dir, fs_root, pathname, subpool) != SVN_NO_ERROR) + return false; + + return is_dir; +} + time_t get_epoch(char *svn_date) { struct tm tm; @@ -309,6 +323,10 @@ int SvnPrivate::exportRevision(int revnum) continue; if (rule.rx.exactMatch(current)) { foundMatch = true; + if (rule.repository.isEmpty()) + // ignore rule + break; + QString repository = current; QString branch = current; QString path = current; @@ -354,8 +372,12 @@ int SvnPrivate::exportRevision(int revnum) } if (!foundMatch) { - qCritical() << current << "did not match any rules; cannot continue"; - return EXIT_FAILURE; + if (wasDir(fs, revnum - 1, key, pool)) { + qDebug() << current << "was a directory; ignoring"; + } else { + qCritical() << current << "did not match any rules; cannot continue"; + return EXIT_FAILURE; + } } } revpool.clear(); |