aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaja R Harinath <harinath@hurrynot.org>2010-07-19 19:14:03 +0530
committerRaja R Harinath <harinath@hurrynot.org>2010-07-19 19:14:03 +0530
commit8cdfe443e65b3882f9e5cd08c083ad03184d2741 (patch)
tree9832044994bc24d9069eb73c499efaf41d20661e
parentd90465a37df3eb9769acf25294104a8c06053c30 (diff)
downloadsvn2git-8cdfe443e65b3882f9e5cd08c083ad03184d2741.tar
svn2git-8cdfe443e65b3882f9e5cd08c083ad03184d2741.tar.gz
svn2git-8cdfe443e65b3882f9e5cd08c083ad03184d2741.tar.bz2
svn2git-8cdfe443e65b3882f9e5cd08c083ad03184d2741.tar.xz
svn2git-8cdfe443e65b3882f9e5cd08c083ad03184d2741.zip
Make the new incremental mode permanent
With the changes made to Repository::reloadBranches when --incremental was introduced, the older mode wasn't working, anyway.
-rw-r--r--src/main.cpp46
1 files changed, 21 insertions, 25 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 37b8615..1982627 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -72,7 +72,6 @@ static const CommandLineOption options[] = {
{"--dry-run", "don't actually write anything"},
{"--debug-rules", "print what rule is being used for each file"},
{"--commit-interval NUMBER", "if passed the cache will be flushed to git every NUMBER of commits"},
- {"--incremental", "attempts to restart an import based on information in log-* and git-fast-import"},
{"-h, --help", "show help"},
{"-v, --version", "show version"},
CommandLineLastOption
@@ -119,7 +118,6 @@ int main(int argc, char **argv)
// create the repository list
QHash<QString, Repository *> repositories;
- bool incremental = args->contains("incremental");
int cutoff = resume_from ? resume_from : INT_MAX;
retry:
@@ -128,32 +126,30 @@ int main(int argc, char **argv)
Repository *repo = new Repository(rule);
repositories.insert(rule.name, repo);
- if (incremental) {
- int repo_next = repo->setupIncremental(cutoff);
+ int repo_next = repo->setupIncremental(cutoff);
+ /*
+ * cutoff < resume_from => error exit eventually
+ * repo_next == cutoff => probably truncated log
+ */
+ if (cutoff < resume_from && repo_next == cutoff)
/*
- * cutoff < resume_from => error exit eventually
- * repo_next == cutoff => probably truncated log
+ * Restore the log file so we fail the next time
+ * svn2git is invoked with the same arguments
*/
- if (cutoff < resume_from && repo_next == cutoff)
- /*
- * Restore the log file so we fail the next time
- * svn2git is invoked with the same arguments
- */
- repo->restoreLog();
-
- if (cutoff < min_rev)
- /*
- * We've rewound before the last revision of some
- * repository that we've already seen. Start over
- * from the beginning. (since cutoff is decreasing,
- * we're sure we'll make forward progress eventually)
- */
- goto retry;
-
- if (min_rev < repo_next)
- min_rev = repo_next;
- }
+ repo->restoreLog();
+
+ if (cutoff < min_rev)
+ /*
+ * We've rewound before the last revision of some
+ * repository that we've already seen. Start over
+ * from the beginning. (since cutoff is decreasing,
+ * we're sure we'll make forward progress eventually)
+ */
+ goto retry;
+
+ if (min_rev < repo_next)
+ min_rev = repo_next;
}
if (cutoff < resume_from) {