@@ -303,12 +303,32 @@ static int dumpBlob(Repository::Transaction *txn, svn_fs_root_t *fs_root,
303
303
return EXIT_SUCCESS;
304
304
}
305
305
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,
307
321
const QByteArray &pathname, const QString &finalPathName,
308
322
apr_pool_t *pool, svn_revnum_t revnum,
309
323
const Rules::Match &rule, const MatchRuleList &matchRules,
310
324
bool ruledebug)
311
325
{
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
+
312
332
// get the dir listing
313
333
apr_hash_t *entries;
314
334
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
346
366
continue ;
347
367
}
348
368
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)
350
370
return EXIT_FAILURE;
351
371
} else if (i.value () == svn_node_file) {
352
372
printf (" +" );
@@ -359,20 +379,6 @@ static int recursiveDumpDir(Repository::Transaction *txn, svn_fs_root_t *fs_root
359
379
return EXIT_SUCCESS;
360
380
}
361
381
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
-
376
382
time_t get_epoch (const char * svn_date)
377
383
{
378
384
struct tm tm ;
@@ -841,7 +847,7 @@ int SvnRevision::exportInternal(const char *key, const svn_fs_path_change2_t *ch
841
847
if (ruledebug)
842
848
qDebug () << " Create a true SVN copy of branch (" << key << " ->" << branch << path << " )" ;
843
849
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);
845
851
}
846
852
if (rule.annotate ) {
847
853
// create an annotated tag
@@ -925,7 +931,7 @@ int SvnRevision::exportInternal(const char *key, const svn_fs_path_change2_t *ch
925
931
if (ignoreSet == false ) {
926
932
txn->deleteFile (path);
927
933
}
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);
929
935
}
930
936
931
937
return EXIT_SUCCESS;
0 commit comments