]> andersk Git - svn-all-fast-export.git/commitdiff
Introduce the dry-run mode
authorThiago Macieira <thiago@cassini.local.lan>
Sun, 23 Dec 2007 21:31:35 +0000 (19:31 -0200)
committerThiago Macieira <thiago@cassini.local.lan>
Sun, 23 Dec 2007 21:31:35 +0000 (19:31 -0200)
src/repository.cpp
src/svn.cpp

index 966b73dfee75580d4e22e626cfc103c52ebd39f0..bd229f0bccfbccacc240d3ac3c8aa6760df15a1c 100644 (file)
@@ -54,9 +54,14 @@ Repository::Transaction *Repository::newTransaction(const QString &branch, const
     txn->revnum = revnum;
     txn->lastmark = revnum;
 
-    if (fastImport.state() == QProcess::NotRunning)
+    if (fastImport.state() == QProcess::NotRunning) {
         // start the process
+#ifndef DRY_RUN
         fastImport.start("git-fast-import", QStringList());
+#else
+        fastImport.start("/bin/cat", QStringList());
+#endif
+    }
 
     return txn;
 }
@@ -91,12 +96,14 @@ QIODevice *Repository::Transaction::addFile(const QString &path, int mode, qint6
     fp.mode = mode;
     fp.mark = ++lastmark;
 
+#ifndef DRY_RUN
     repository->fastImport.write("blob\nmark :");
     repository->fastImport.write(QByteArray::number(fp.mark));
     repository->fastImport.write("\ndata ");
     repository->fastImport.write(QByteArray::number(length));
     repository->fastImport.write("\n", 1);
     repository->fastImport.waitForBytesWritten(0);
+#endif
 
     modifiedFiles.insert(path, fp);
     return &repository->fastImport;
index 760e73654f250c8e8bebb56053b45a87cc692f2b..aeca0fc25c415a728a79e4b90270d4b1aa393045 100644 (file)
@@ -197,13 +197,14 @@ static int dumpBlob(Repository::Transaction *txn, svn_fs_root_t *fs_root,
     // what type is it?
     int mode = pathMode(fs_root, pathname, pool);
 
-    svn_stream_t *in_stream, *out_stream;
     svn_filesize_t stream_length;
 
     SVN_ERR(svn_fs_file_length(&stream_length, fs_root, pathname, pool));
     QIODevice *io = txn->addFile(pathname, mode, stream_length);
 
+#ifndef DRY_RUN
     // open the file
+    svn_stream_t *in_stream, *out_stream;
     SVN_ERR(svn_fs_file_contents(&in_stream, fs_root, pathname, pool));
 
     // open a generic svn_stream_t for the QIODevice
@@ -212,6 +213,7 @@ static int dumpBlob(Repository::Transaction *txn, svn_fs_root_t *fs_root,
 
     // print an ending newline
     io->putChar('\n');
+#endif
 
     return EXIT_SUCCESS;
 }
This page took 0.033519 seconds and 5 git commands to generate.