# # # patch "src/model/GetBranchLog.cpp" # from [2db62d5dcefd54666050618e5948616392fcc28e] # to [9c825f55da2e26f9c67eb221cc837a8ef1c47364] # ============================================================ --- src/model/GetBranchLog.cpp 2db62d5dcefd54666050618e5948616392fcc28e +++ src/model/GetBranchLog.cpp 9c825f55da2e26f9c67eb221cc837a8ef1c47364 @@ -85,7 +85,9 @@ void GetBranchLog::readMore(const QStrin if (!nextRevs.contains(currentBranch)) { - MonotoneTaskPtr task(new MonotoneTask(QStringList() << "select" << "h:" + branch)); + MonotoneTaskPtr task(new MonotoneTask( + QStringList() << "select" << "h:" + currentBranch + )); AutomateCommand::enqueueDatabaseTask(databaseFile, task); } else @@ -138,6 +140,23 @@ void GetBranchLog::processTaskResult(con { QStringList revs = output.split("\n", QString::SkipEmptyParts); + // if we couldn't find any heads for the selected branch, + // try a little harder to find some heads by including any + // suspended ones + if (current == "select" && revs.size() == 0) + { + // ensure we haven't done all this already + I(task->getOptions().size() == 0); + + MonotoneTaskPtr task(new MonotoneTask( + QStringList() << "select" << "h:" currentBranch, + QStringList() << "ignore-suspend-certs" << "" + )); + + AutomateCommand::enqueueDatabaseTask(databaseFile, task); + return; + } + // there is a small race condition where readNext() already processes // one of the next revisions before they're sorted, so we just have // to remove that from the sorted list; also additional revisions might @@ -148,6 +167,7 @@ void GetBranchLog::processTaskResult(con if (nextRevs.value(currentBranch).contains(rev)) processed.append(rev); } + foreach (const QString & rev, nextRevs.value(currentBranch)) { if (!revs.contains(rev))