From 58378dcd8d758ccac2465547457dc586e2443fab Mon Sep 17 00:00:00 2001 From: Torgny Nyblom Date: Wed, 1 May 2019 15:17:52 +0200 Subject: [PATCH] Revert Maintain annotated tags throughout incremental runs #60 Revert MR # 60 Maintain annotated tags throughout incremental runs Due to compile error --- src/main.cpp | 1 - src/repository.cpp | 55 +--------------------------------------------- src/repository.h | 1 - 3 files changed, 1 insertion(+), 56 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 4c39fc3..187e4c1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -211,7 +211,6 @@ int main(int argc, char **argv) repositories.insert(rule.name, repo); int repo_next = repo->setupIncremental(cutoff); - repo->restoreAnnotatedTags(); repo->restoreBranchNotes(); /* diff --git a/src/repository.cpp b/src/repository.cpp index 0e4aac5..905138c 100644 --- a/src/repository.cpp +++ b/src/repository.cpp @@ -78,7 +78,6 @@ class FastImportRepository : public Repository }; FastImportRepository(const Rules::Repository &rule); int setupIncremental(int &cutoff); - void restoreAnnotatedTags(); void restoreBranchNotes(); void restoreLog(); ~FastImportRepository(); @@ -186,7 +185,6 @@ class ForwardingRepository : public Repository ForwardingRepository(const QString &n, Repository *r, const QString &p) : name(n), repo(r), prefix(p) {} int setupIncremental(int &) { return 1; } - void restoreAnnotatedTags() {} void restoreBranchNotes() {} void restoreLog() {} @@ -254,33 +252,6 @@ class ProcessCache: QLinkedList }; static ProcessCache processCache; -QDataStream &operator<<(QDataStream &out, const FastImportRepository::AnnotatedTag &annotatedTag) -{ - out << annotatedTag.supportingRef - << annotatedTag.svnprefix - << annotatedTag.author - << annotatedTag.log - << (quint64) annotatedTag.dt - << (qint64) annotatedTag.revnum; - return out; -} - -QDataStream &operator>>(QDataStream &in, FastImportRepository::AnnotatedTag &annotatedTag) -{ - quint64 dt; - qint64 revnum; - - in >> annotatedTag.supportingRef - >> annotatedTag.svnprefix - >> annotatedTag.author - >> annotatedTag.log - >> dt - >> revnum; - annotatedTag.dt = (uint) dt; - annotatedTag.revnum = (int) revnum; - return in; -} - Repository *createRepository(const Rules::Repository &rule, const QHash &repositories) { if (rule.forwardTo.isEmpty()) @@ -300,13 +271,6 @@ static QString marksFileName(QString name) return name; } -static QString annotatedTagsFileName(QString name) -{ - name.replace('/', '_'); - name.prepend("annotatedTags-"); - return name; -} - static QString branchNotesFileName(QString name) { name.replace('/', '_'); @@ -498,17 +462,6 @@ int FastImportRepository::setupIncremental(int &cutoff) return cutoff; } -void FastImportRepository::restoreAnnotatedTags() -{ - QFile annotatedTagsFile(name + "/" + annotatedTagsFileName(name)); - if (!annotatedTagsFile.exists()) - return; - annotatedTagsFile.open(QIODevice::ReadOnly); - QDataStream annotatedTagsStream(&annotatedTagsFile); - annotatedTagsStream >> annotatedTags; - annotatedTagsFile.close(); -} - void FastImportRepository::restoreBranchNotes() { QFile branchNotesFile(name + "/" + branchNotesFileName(name)); @@ -780,13 +733,7 @@ void FastImportRepository::finalizeTags() if (annotatedTags.isEmpty()) return; - QFile annotatedTagsFile(name + "/" + annotatedTagsFileName(name)); - annotatedTagsFile.open(QIODevice::WriteOnly); - QDataStream annotatedTagsStream(&annotatedTagsFile); - annotatedTagsStream << annotatedTags; - annotatedTagsFile.close(); - - printf("Finalising annotated tags for %s...", qPrintable(name)); + printf("Finalising tags for %s...", qPrintable(name)); startFastImport(); QHash::ConstIterator it = annotatedTags.constBegin(); diff --git a/src/repository.h b/src/repository.h index 1de7517..a7895af 100644 --- a/src/repository.h +++ b/src/repository.h @@ -116,7 +116,6 @@ class Repository const QByteArray &commit = QByteArray()) = 0; }; virtual int setupIncremental(int &cutoff) = 0; - virtual void restoreAnnotatedTags() = 0; virtual void restoreBranchNotes() = 0; virtual void restoreLog() = 0; virtual ~Repository() {}