]> andersk Git - svn-all-fast-export.git/blobdiff - src/repository.cpp
Add auto-recurse code
[svn-all-fast-export.git] / src / repository.cpp
index 08a5306fa6a10722c0fcefd357b94fb9dd5abfad..335278abdbbcfbdc6ea81b5cc48b472b77255231 100644 (file)
@@ -24,9 +24,6 @@ Repository::Repository(const Rules::Repository &rule)
 {
     foreach (Rules::Repository::Branch branchRule, rule.branches) {
         Branch branch;
-        branch.branchFrom = branchRule.branchFrom;
-        if (!branch.branchFrom.startsWith("refs/"))
-            branch.branchFrom.prepend("refs/heads/");
         branch.isCreated = false;
 
         branches.insert(branchRule.name, branch);
@@ -134,7 +131,9 @@ void Repository::startFastImport()
         fastImport.setProcessChannelMode(QProcess::ForwardedChannels);
         fastImport.start("git-fast-import", QStringList());
 #else
-        fastImport.setStandardOutputFile(name);
+        QString outputFile = name;
+        outputFile.replace('/', '_');
+        fastImport.setStandardOutputFile(outputFile, QIODevice::Append);
         fastImport.start("/bin/cat", QStringList());
 #endif
     }
@@ -204,7 +203,6 @@ void Repository::Transaction::commit()
         Branch &br = repository->branches[branch];
         if (!br.isCreated) {
             br.isCreated = true;
-            s << "from " << br.branchFrom << endl;
         }
 
         s << "data " << message.length() << endl;
@@ -213,8 +211,11 @@ void Repository::Transaction::commit()
     repository->fastImport.write(message);
 
     // write the file deletions
-    foreach (QString df, deletedFiles)
-        repository->fastImport.write("D " + df.toUtf8() + "\n");
+    if (deletedFiles.contains(""))
+        repository->fastImport.write("deleteall\n");
+    else
+        foreach (QString df, deletedFiles)
+            repository->fastImport.write("D " + df.toUtf8() + "\n");
 
     // write the file modifications
     QHash<QString, FileProperties>::ConstIterator it = modifiedFiles.constBegin();
This page took 0.030896 seconds and 4 git commands to generate.