| 291 | } |
| 292 | |
| 293 | KDevelop::VcsJob* PerforcePlugin::diff(const QUrl& fileOrDirectory, const KDevelop::VcsRevision& srcRevision, const KDevelop::VcsRevision& dstRevision, KDevelop::IBasicVersionControl::RecursionMode /*recursion*/) |
| 294 | { |
| 295 | QFileInfo curFile(fileOrDirectory.toLocalFile()); |
| 296 | QString depotSrcFileName = getRepositoryName(curFile); |
| 297 | QString depotDstFileName = depotSrcFileName; |
| 298 | depotSrcFileName.append(toRevisionName(srcRevision, dstRevision.prettyValue())); // dstRevision actually contains the number that we want to take previous of |
| 299 | |
| 300 | auto* job = new DVcsJob(curFile.dir(), this, KDevelop::OutputJob::Verbose); |
| 301 | setEnvironmentForJob(job, curFile); |
| 302 | switch (dstRevision.revisionType()) { |
| 303 | case VcsRevision::FileNumber: |
| 304 | case VcsRevision::GlobalNumber: |
| 305 | depotDstFileName.append(QLatin1Char('#') + dstRevision.prettyValue()); |
| 306 | *job << m_perforceExecutable << "diff2" << "-u" << depotSrcFileName << depotDstFileName; |
| 307 | break; |
| 308 | case VcsRevision::Special: |
| 309 | switch (dstRevision.revisionValue().value<VcsRevision::RevisionSpecialType>()) { |
| 310 | case VcsRevision::Working: |
| 311 | *job << m_perforceExecutable << "diff" << "-du" << depotSrcFileName; |
| 312 | break; |
| 313 | case VcsRevision::Start: |
| 314 | case VcsRevision::UserSpecialType: |
| 315 | default: |
| 316 | break; |
| 317 | } |
| 318 | break; |
| 319 | default: |
| 320 | break; |
| 321 | } |
| 322 | |
| 323 | connect(job, &DVcsJob::readyForParsing, this, &PerforcePlugin::parseP4DiffOutput); |
| 324 | return job; |
| 325 | } |
| 326 | |
| 327 | KDevelop::VcsJob* PerforcePlugin::log(const QUrl& localLocation, const KDevelop::VcsRevision& rev, long unsigned int limit) |
| 328 | { |