diff options
author | Torgny Nyblom <kde@nyblom.org> | 2010-03-25 19:01:34 +0100 |
---|---|---|
committer | Torgny Nyblom <kde@nyblom.org> | 2010-03-25 19:01:34 +0100 |
commit | c9c52bc1415082f39738c402317a25c6991f8369 (patch) | |
tree | 1d27aac8ef351ea5147caabe572dbd3470ba69d8 | |
parent | 8b4c690f47700ceb242b39aef2609c370c67caf9 (diff) | |
download | svn2git-c9c52bc1415082f39738c402317a25c6991f8369.tar svn2git-c9c52bc1415082f39738c402317a25c6991f8369.tar.gz svn2git-c9c52bc1415082f39738c402317a25c6991f8369.tar.bz2 svn2git-c9c52bc1415082f39738c402317a25c6991f8369.tar.xz svn2git-c9c52bc1415082f39738c402317a25c6991f8369.zip |
Add commandline option for when to flush the commit queue.
-rw-r--r-- | src/main.cpp | 1 | ||||
-rw-r--r-- | src/repository.cpp | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp index a655305..4032b71 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -61,6 +61,7 @@ static const CommandLineOption options[] = { {"--resume-from revision", "start importing at svn revision number"}, {"--max-rev revision", "stop importing at svn revision number"}, {"--dry-run", "don't actually write anything"}, + {"--commit-interval NUMBER", "if passed the cache will be flushed to git every NUMBER of commits"}, {"-h, --help", "show help"}, {"-v, --version", "show version"}, CommandLineLastOption diff --git a/src/repository.cpp b/src/repository.cpp index 48aa65f..df0df8f 100644 --- a/src/repository.cpp +++ b/src/repository.cpp @@ -174,7 +174,7 @@ Repository::Transaction *Repository::newTransaction(const QString &branch, const txn->datetime = 0; txn->revnum = revnum; - if ((++commitCount % 10000) == 0) + if ((++commitCount % CommandLineParser::instance()->optionArgument(QLatin1String("commit-interval"), QLatin1String("10000")).toInt()) == 0) // write everything to disk every 10000 commits fastImport.write("checkpoint\n"); if (outstandingTransactions++ == 0) |