aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaja R Harinath <harinath@hurrynot.org>2010-06-19 20:31:31 +0530
committerRaja R Harinath <harinath@hurrynot.org>2010-06-19 20:54:04 +0530
commit2de3ef976eeb1c860d082ed73a58c02be5834923 (patch)
treefd2e860497d6bab3d4d793404d2897169016831e
parent150234320a79003d130f6528a35cda5ce523e1a5 (diff)
downloadsvn2git-2de3ef976eeb1c860d082ed73a58c02be5834923.tar
svn2git-2de3ef976eeb1c860d082ed73a58c02be5834923.tar.gz
svn2git-2de3ef976eeb1c860d082ed73a58c02be5834923.tar.bz2
svn2git-2de3ef976eeb1c860d082ed73a58c02be5834923.tar.xz
svn2git-2de3ef976eeb1c860d082ed73a58c02be5834923.zip
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.
-rw-r--r--src/repository.cpp12
1 files 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());
}