# # # patch "src/model/GetBranchLog.cpp" # from [4f53ccedca50123c2632de11b4820505f66eaf67] # to [c9066da970e01b5e0b89f9cb5a28968507e5d021] # ============================================================ --- src/model/GetBranchLog.cpp 4f53ccedca50123c2632de11b4820505f66eaf67 +++ src/model/GetBranchLog.cpp c9066da970e01b5e0b89f9cb5a28968507e5d021 @@ -106,11 +106,6 @@ void GetBranchLog::processTaskResult(con QStringList revs = output.split("\n", QString::SkipEmptyParts); - int newRow = revisionMap[currentBranch].size(); - beginInsertRows(QModelIndex(), newRow, newRow + revs.size() - 1); - revisionMap[currentBranch] += revs; - endInsertRows(); - if (current == "parents" && revs.size() > 1) { mergeRevs.insert(task->getArguments().at(1)); @@ -118,13 +113,24 @@ void GetBranchLog::processTaskResult(con foreach (QString rev, revs) { + // we found a parent which we already recorded + if (revisionMap[currentBranch].contains(rev)) + continue; + + int newRow = revisionMap[currentBranch].size(); + beginInsertRows(QModelIndex(), newRow, newRow); + + revisionMap[currentBranch].append(rev); revsRead++; nextRevs[currentBranch].push(rev); + if (!certMap.contains(rev)) { MonotoneTaskPtr task(new MonotoneTask(QStringList() << "certs" << rev)); AutomateCommand::enqueueDatabaseTask(databaseFile, task); } + + endInsertRows(); } readNext(); @@ -133,6 +139,8 @@ void GetBranchLog::processTaskResult(con if (current == "certs") { QString queriedRev = task->getArguments().at(1); + int row = revisionMap[currentBranch].indexOf(queriedRev); + I(row >= 0); BasicIOParser parser(output); I(parser.parse()); @@ -142,8 +150,6 @@ void GetBranchLog::processTaskResult(con certs.fill(parser.getStanzas()); certMap.insert(queriedRev, certs); - int row = revisionMap[currentBranch].indexOf(queriedRev); - I(row >= 0); emit dataChanged(index(row, 0, QModelIndex()), index(row, 3, QModelIndex())); } }