From 2de3ef976eeb1c860d082ed73a58c02be5834923 Mon Sep 17 00:00:00 2001 From: Raja R Harinath Date: Sat, 19 Jun 2010 20:31:31 +0530 Subject: Store marks to file so that the ProcessCache system works Branches and marks are now long-lived. The marks have to survive even if the fast-import process goes away. So, use the --import- and --export-marks feature of fast-import to persist marks. These marks are only meant for the duration of this 'svn-all-fast-export' and don't confer any new incremental behaviour. You'll need a mark to SVN commit map for that, at least. --- src/repository.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/repository.cpp b/src/repository.cpp index 91f239e..6627568 100644 --- a/src/repository.cpp +++ b/src/repository.cpp @@ -73,6 +73,12 @@ Repository::Repository(const Rules::Repository &rule) init.setWorkingDirectory(name); init.start("git", QStringList() << "--bare" << "init"); init.waitForFinished(-1); + QDir::current().mkpath(name + "/info/fast-import"); + { + QFile marks(name + "/info/fast-import/marks"); + marks.open(QIODevice::WriteOnly); + marks.close(); + } } } } @@ -111,7 +117,9 @@ void Repository::reloadBranches() QByteArray branchName = revParse.readLine().trimmed(); //qDebug() << "Repo" << name << "reloaded branch" << branchName; - branches[branchName].created = 1; + + Q_ASSERT(branches[branchName].created); + fastImport.write("reset refs/heads/" + branchName + "\nfrom refs/heads/" + branchName + "^0\n\n" "progress Branch refs/heads/" + branchName + " reloaded\n"); @@ -276,7 +284,7 @@ void Repository::startFastImport() fastImport.setProcessChannelMode(QProcess::MergedChannels); if (!CommandLineParser::instance()->contains("dry-run")) { - fastImport.start("git", QStringList() << "fast-import"); + fastImport.start("git", QStringList() << "fast-import" << "--relative-marks" << "--import-marks=marks" << "--export-marks=marks"); } else { fastImport.start("/bin/cat", QStringList()); } -- cgit v1.2.1