@@ -303,12 +303,32 @@ static int dumpBlob(Repository::Transaction *txn, svn_fs_root_t *fs_root,
303303 return EXIT_SUCCESS;
304304}
305305
306- static int recursiveDumpDir (Repository::Transaction *txn, svn_fs_root_t *fs_root,
306+ static bool wasDir (svn_fs_t *fs, int revnum, const char *pathname, apr_pool_t *pool)
307+ {
308+ AprAutoPool subpool (pool);
309+ svn_fs_root_t *fs_root;
310+ if (svn_fs_revision_root (&fs_root, fs, revnum, subpool) != SVN_NO_ERROR)
311+ return false ;
312+
313+ svn_boolean_t is_dir;
314+ if (svn_fs_is_dir (&is_dir, fs_root, pathname, subpool) != SVN_NO_ERROR)
315+ return false ;
316+
317+ return is_dir;
318+ }
319+
320+ static int recursiveDumpDir (Repository::Transaction *txn, svn_fs_t *fs, svn_fs_root_t *fs_root,
307321 const QByteArray &pathname, const QString &finalPathName,
308322 apr_pool_t *pool, svn_revnum_t revnum,
309323 const Rules::Match &rule, const MatchRuleList &matchRules,
310324 bool ruledebug)
311325{
326+ if (!wasDir (fs, revnum, pathname.data (), pool)) {
327+ if (dumpBlob (txn, fs_root, pathname, finalPathName, pool) == EXIT_FAILURE)
328+ return EXIT_FAILURE;
329+ return EXIT_SUCCESS;
330+ }
331+
312332 // get the dir listing
313333 apr_hash_t *entries;
314334 SVN_ERR (svn_fs_dir_entries (&entries, fs_root, pathname, pool));
@@ -346,7 +366,7 @@ static int recursiveDumpDir(Repository::Transaction *txn, svn_fs_root_t *fs_root
346366 continue ;
347367 }
348368
349- if (recursiveDumpDir (txn, fs_root, entryName, entryFinalName, dirpool, revnum, rule, matchRules, ruledebug) == EXIT_FAILURE)
369+ if (recursiveDumpDir (txn, fs, fs_root, entryName, entryFinalName, dirpool, revnum, rule, matchRules, ruledebug) == EXIT_FAILURE)
350370 return EXIT_FAILURE;
351371 } else if (i.value () == svn_node_file) {
352372 printf (" +" );
@@ -359,20 +379,6 @@ static int recursiveDumpDir(Repository::Transaction *txn, svn_fs_root_t *fs_root
359379 return EXIT_SUCCESS;
360380}
361381
362- static bool wasDir (svn_fs_t *fs, int revnum, const char *pathname, apr_pool_t *pool)
363- {
364- AprAutoPool subpool (pool);
365- svn_fs_root_t *fs_root;
366- if (svn_fs_revision_root (&fs_root, fs, revnum, subpool) != SVN_NO_ERROR)
367- return false ;
368-
369- svn_boolean_t is_dir;
370- if (svn_fs_is_dir (&is_dir, fs_root, pathname, subpool) != SVN_NO_ERROR)
371- return false ;
372-
373- return is_dir;
374- }
375-
376382time_t get_epoch (const char * svn_date)
377383{
378384 struct tm tm;
@@ -841,7 +847,7 @@ int SvnRevision::exportInternal(const char *key, const svn_fs_path_change2_t *ch
841847 if (ruledebug)
842848 qDebug () << " Create a true SVN copy of branch (" << key << " ->" << branch << path << " )" ;
843849 txn->deleteFile (path);
844- recursiveDumpDir (txn, fs_root, key, path, pool, revnum, rule, matchRules, ruledebug);
850+ recursiveDumpDir (txn, fs, fs_root, key, path, pool, revnum, rule, matchRules, ruledebug);
845851 }
846852 if (rule.annotate ) {
847853 // create an annotated tag
@@ -925,7 +931,7 @@ int SvnRevision::exportInternal(const char *key, const svn_fs_path_change2_t *ch
925931 if (ignoreSet == false ) {
926932 txn->deleteFile (path);
927933 }
928- recursiveDumpDir (txn, fs_root, key, path, pool, revnum, rule, matchRules, ruledebug);
934+ recursiveDumpDir (txn, fs, fs_root, key, path, pool, revnum, rule, matchRules, ruledebug);
929935 }
930936
931937 return EXIT_SUCCESS;
0 commit comments