Skip to content

Commit

Permalink
Revert Maintain annotated tags throughout incremental runs #60
Browse files Browse the repository at this point in the history
Revert MR # 60 Maintain annotated tags throughout incremental runs

Due to compile error
  • Loading branch information
tnyblom committed May 1, 2019
1 parent c9e7c4a commit 58378dc
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 56 deletions.
1 change: 0 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();

/*
Expand Down
55 changes: 1 addition & 54 deletions src/repository.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ class FastImportRepository : public Repository
};
FastImportRepository(const Rules::Repository &rule);
int setupIncremental(int &cutoff);
void restoreAnnotatedTags();
void restoreBranchNotes();
void restoreLog();
~FastImportRepository();
Expand Down Expand Up @@ -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() {}

Expand Down Expand Up @@ -254,33 +252,6 @@ class ProcessCache: QLinkedList<FastImportRepository *>
};
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<QString, Repository *> &repositories)
{
if (rule.forwardTo.isEmpty())
Expand All @@ -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('/', '_');
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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<QString, AnnotatedTag>::ConstIterator it = annotatedTags.constBegin();
Expand Down
1 change: 0 additions & 1 deletion src/repository.h
Original file line number Diff line number Diff line change
Expand Up @@ -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() {}
Expand Down

0 comments on commit 58378dc

Please sign in to comment.