diff options
author | Torgny Nyblom <kde@nyblom.org> | 2010-09-17 13:19:37 +0200 |
---|---|---|
committer | Torgny Nyblom <kde@nyblom.org> | 2010-09-17 13:19:37 +0200 |
commit | cdedb4a5ce81f717351baef9195894ef7b1b0a84 (patch) | |
tree | 73ab0f77b8841d59af608ddbf0a1ae7ca4753771 /src | |
parent | 05968a48886e95d11439a29c0510d31e27f44a6c (diff) | |
download | svn2git-cdedb4a5ce81f717351baef9195894ef7b1b0a84.tar svn2git-cdedb4a5ce81f717351baef9195894ef7b1b0a84.tar.gz svn2git-cdedb4a5ce81f717351baef9195894ef7b1b0a84.tar.bz2 svn2git-cdedb4a5ce81f717351baef9195894ef7b1b0a84.tar.xz svn2git-cdedb4a5ce81f717351baef9195894ef7b1b0a84.zip |
Readd br.marks.last() to various places as a mark of "0" is used to mark
a branch as deleted.
Thanks Raja R Harinath for spotting it.
Diffstat (limited to 'src')
-rw-r--r-- | src/repository.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/repository.cpp b/src/repository.cpp index 5c8d9c1..a19b794 100644 --- a/src/repository.cpp +++ b/src/repository.cpp @@ -420,7 +420,7 @@ int FastImportRepository::setupIncremental(int &cutoff) last_commit_mark = mark; Branch &br = branches[branch]; - if (!br.created || !mark || br.marks.isEmpty()) + if (!br.created || !mark || br.marks.isEmpty() || !br.marks.last()) br.created = revnum; br.commits.append(revnum); br.marks.append(mark); @@ -484,7 +484,7 @@ void FastImportRepository::reloadBranches() foreach (QString branch, branches.keys()) { Branch &br = branches[branch]; - if (!br.marks.count() || !br.marks.last()) + if (br.marks.isEmpty() || !br.marks.last()) continue; QByteArray branchRef = branch.toUtf8(); @@ -572,7 +572,7 @@ int FastImportRepository::resetBranch(const QString &branch, int revnum, int mar branchRef.prepend("refs/heads/"); Branch &br = branches[branch]; - if (br.created && br.created != revnum && !br.marks.isEmpty()) { + if (br.created && br.created != revnum && !br.marks.isEmpty() && br.marks.last()) { QByteArray backupBranch = "refs/backups/r" + QByteArray::number(revnum) + branchRef.mid(4); qWarning() << "backing up branch" << branch << "to" << backupBranch; @@ -824,7 +824,7 @@ void FastImportRepository::Transaction::commit() int parentmark = 0; Branch &br = repository->branches[branch]; - if (br.created && !br.marks.isEmpty()) { + if (br.created && !br.marks.isEmpty() && br.marks.last()) { parentmark = br.marks.last(); } else { qWarning() << "Branch" << branch << "in repository" << repository->name << "doesn't exist at revision" |