MCPcopy Create free account
hub / github.com/KDE/kdevelop / log

Method log

plugins/perforce/perforceplugin.cpp:327–358  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

325}
326
327KDevelop::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
360KDevelop::VcsJob* PerforcePlugin::log(const QUrl& localLocation, const KDevelop::VcsRevision& /*rev*/, const KDevelop::VcsRevision& /*limit*/)
361{

Callers 1

testHistoryMethod · 0.45

Calls 8

toLocalFileMethod · 0.80
dvcsCommandMethod · 0.80
urlDirFunction · 0.70
toRevisionNameFunction · 0.70
QStringClass · 0.50
appendMethod · 0.45
isEmptyMethod · 0.45
clearMethod · 0.45

Tested by 1

testHistoryMethod · 0.36