From c9c52bc1415082f39738c402317a25c6991f8369 Mon Sep 17 00:00:00 2001 From: Torgny Nyblom Date: Thu, 25 Mar 2010 19:01:34 +0100 Subject: Add commandline option for when to flush the commit queue. --- src/main.cpp | 1 + src/repository.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'src') 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) -- cgit v1.2.1