| 325 | } |
| 326 | |
| 327 | KDevelop::VcsJob* PerforcePlugin::log(const QUrl& localLocation, const KDevelop::VcsRevision& rev, long unsigned int limit) |
| 328 | { |
| 329 | static QString lastSeenChangeList; |
| 330 | QFileInfo curFile(localLocation.toLocalFile()); |
| 331 | QString localLocationAndRevStr = localLocation.toLocalFile(); |
| 332 | |
| 333 | auto* job = new DVcsJob(urlDir(localLocation), this, KDevelop::OutputJob::Verbose); |
| 334 | setEnvironmentForJob(job, curFile); |
| 335 | *job << m_perforceExecutable << "filelog" << "-lit"; |
| 336 | if(limit > 0) |
| 337 | *job << QStringLiteral("-m %1").arg(limit); |
| 338 | |
| 339 | if (curFile.isDir()) { |
| 340 | localLocationAndRevStr.append(QLatin1String("/...")); |
| 341 | } |
| 342 | QString revStr = toRevisionName(rev, QString()); |
| 343 | if(!revStr.isEmpty()) { |
| 344 | // This is not too nice, but perforce argument for restricting output from filelog does not Work :-( |
| 345 | // So putting this in so we do not end up in infinite loop calling log, |
| 346 | if(revStr == lastSeenChangeList) { |
| 347 | localLocationAndRevStr.append(QLatin1String("#none")); |
| 348 | lastSeenChangeList.clear(); |
| 349 | } else { |
| 350 | localLocationAndRevStr.append(revStr); |
| 351 | lastSeenChangeList = revStr; |
| 352 | } |
| 353 | } |
| 354 | *job << localLocationAndRevStr; |
| 355 | qCDebug(PLUGIN_PERFORCE) << "Issuing the following command to p4: " << job->dvcsCommand(); |
| 356 | connect(job, &DVcsJob::readyForParsing, this, &PerforcePlugin::parseP4LogOutput); |
| 357 | return job; |
| 358 | } |
| 359 | |
| 360 | KDevelop::VcsJob* PerforcePlugin::log(const QUrl& localLocation, const KDevelop::VcsRevision& /*rev*/, const KDevelop::VcsRevision& /*limit*/) |
| 361 | { |