aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Hagerty <hag@linnaean.org>2012-10-07 15:26:26 +0200
committerUlrich Spörlein <uqs@spoerlein.net>2012-10-07 15:26:26 +0200
commit8f8d4c770ac4884dc6c7909a342b27b28f23cbd9 (patch)
tree2aa188a0816f57364825bb14805df55b0c0e1b7e
parentc0187417902b10698135727d911ab9018f4941eb (diff)
downloadsvn2git-8f8d4c770ac4884dc6c7909a342b27b28f23cbd9.tar
svn2git-8f8d4c770ac4884dc6c7909a342b27b28f23cbd9.tar.gz
svn2git-8f8d4c770ac4884dc6c7909a342b27b28f23cbd9.tar.bz2
svn2git-8f8d4c770ac4884dc6c7909a342b27b28f23cbd9.tar.xz
svn2git-8f8d4c770ac4884dc6c7909a342b27b28f23cbd9.zip
Set marks on notes, so fast-load picks up from previous state.
This should fix the notes upon successive, incremental conversions.
-rw-r--r--src/repository.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/repository.cpp b/src/repository.cpp
index 25215ae..abd037a 100644
--- a/src/repository.cpp
+++ b/src/repository.cpp
@@ -26,7 +26,7 @@
static const int maxSimultaneousProcesses = 100;
-static const int maxMark = (1 << 20) - 1; // some versions of git-fast-import are buggy for larger values of maxMark
+static const int maxMark = (1 << 20) - 2; // some versions of git-fast-import are buggy for larger values of maxMark
class ProcessCache: QLinkedList<Repository *>
{
@@ -271,12 +271,15 @@ void Repository::closeFastImport()
void Repository::reloadBranches()
{
+ bool reset_notes = false;
foreach (QString branch, branches.keys()) {
Branch &br = branches[branch];
if (br.marks.isEmpty() || !br.marks.last())
continue;
+ reset_notes = true;
+
QByteArray branchRef = branch.toUtf8();
if (!branchRef.startsWith("refs/"))
branchRef.prepend("refs/heads/");
@@ -285,6 +288,13 @@ void Repository::reloadBranches()
"\nfrom :" + QByteArray::number(br.marks.last()) + "\n\n"
"progress Branch " + branchRef + " reloaded\n");
}
+
+ if (reset_notes &&
+ CommandLineParser::instance()->contains("add-metadata-notes")) {
+ fastImport.write("reset refs/notes/commits\nfrom :" +
+ QByteArray::number(maxMark + 1) +
+ "\n");
+ }
}
int Repository::markFrom(const QString &branchFrom, int branchRevNum, QByteArray &branchFromDesc)
@@ -674,6 +684,7 @@ void Repository::Transaction::commitNote(const QByteArray &noteText, bool append
QTextStream s(&repository->fastImport);
s << "commit refs/notes/commits" << endl
+ << "mark :" << QByteArray::number(maxMark + 1) << endl
<< "committer " << QString::fromUtf8(author) << ' ' << datetime << " +0000" << endl
<< "data " << message.length() << endl
<< message << endl