]> andersk Git - svn-all-fast-export.git/blobdiff - src/svn.cpp
Allow one commit to multiple branches of the same repository.
[svn-all-fast-export.git] / src / svn.cpp
index 05f3201de5d321d10e46d9edce6155822300e648..0314c3c7787b1a4be9c0e7ff7ba37c82fec30c22 100644 (file)
@@ -284,13 +284,10 @@ static int recursiveDumpDir(Repository::Transaction *txn, svn_fs_root_t *fs_root
 
         svn_fs_dirent_t *dirent = reinterpret_cast<svn_fs_dirent_t *>(value);
         QByteArray entryName = pathname + '/' + dirent->name;
-        QString entryFinalName;
-        if (finalPathName.isEmpty())
-            entryFinalName = dirent->name;
-        else
-            entryFinalName = finalPathName + '/' + dirent->name;
+        QString entryFinalName = finalPathName + dirent->name;
 
         if (dirent->kind == svn_node_dir) {
+            entryFinalName += '/';
             if (recursiveDumpDir(txn, fs_root, entryName, entryFinalName, dirpool) == EXIT_FAILURE)
                 return EXIT_FAILURE;
         } else if (dirent->kind == svn_node_file) {
@@ -556,7 +553,7 @@ int SvnRevision::exportInternal(const char *key, const svn_fs_path_change_t *cha
         }
     }
 
-    Repository::Transaction *txn = transactions.value(repository, 0);
+    Repository::Transaction *txn = transactions.value(repository + branch, 0);
     if (!txn) {
         Repository *repo = repositories.value(repository, 0);
         if (!repo) {
@@ -569,7 +566,7 @@ int SvnRevision::exportInternal(const char *key, const svn_fs_path_change_t *cha
         if (!txn)
             return EXIT_FAILURE;
 
-        transactions.insert(repository, txn);
+        transactions.insert(repository + branch, txn);
     }
 
     if (change->change_kind == svn_fs_path_change_delete) {
@@ -577,7 +574,9 @@ int SvnRevision::exportInternal(const char *key, const svn_fs_path_change_t *cha
     } else if (!current.endsWith('/')) {
         dumpBlob(txn, fs_root, key, path, pool);
     } else {
-        txn->deleteFile(path);
+        QString pathNoSlash = path;
+        pathNoSlash.chop(1);
+        txn->deleteFile(pathNoSlash);
         recursiveDumpDir(txn, fs_root, key, path, pool);
     }
 
@@ -628,4 +627,6 @@ int SvnRevision::recurse(const char *path, const svn_fs_path_change_t *change,
             return EXIT_FAILURE;
         }
     }
+
+    return EXIT_SUCCESS;
 }
This page took 0.386398 seconds and 4 git commands to generate.