Commit 316895ed authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧
Browse files

Make it possible to diff last changes, improve the support to intervals with previous.

parent 34a452a1
...@@ -98,7 +98,7 @@ QString toRevisionName(const KDevelop::VcsRevision& rev, QString currentRevision ...@@ -98,7 +98,7 @@ QString toRevisionName(const KDevelop::VcsRevision& rev, QString currentRevision
case VcsRevision::Head: case VcsRevision::Head:
return "^HEAD"; return "^HEAD";
case VcsRevision::Base: case VcsRevision::Base:
return "HEAD"; return "";
case VcsRevision::Working: case VcsRevision::Working:
return ""; return "";
case VcsRevision::Previous: case VcsRevision::Previous:
...@@ -124,15 +124,17 @@ QString toRevisionName(const KDevelop::VcsRevision& rev, QString currentRevision ...@@ -124,15 +124,17 @@ QString toRevisionName(const KDevelop::VcsRevision& rev, QString currentRevision
QString revisionInterval(const KDevelop::VcsRevision& rev, const KDevelop::VcsRevision& limit) QString revisionInterval(const KDevelop::VcsRevision& rev, const KDevelop::VcsRevision& limit)
{ {
QString ret; QString ret;
QString srcRevisionName = toRevisionName(rev); // qDebug() << "prrrrrrrrrr" << toRevisionName(rev, "xxx") << toRevisionName(limit, "yyy");
if(limit.revisionType()==VcsRevision::Special &&
limit.revisionValue().value<VcsRevision::RevisionSpecialType>()==VcsRevision::Start) //if we want it to the begining just put the revisionInterval if(rev.revisionType()==VcsRevision::Special &&
return ret = srcRevisionName; rev.revisionValue().value<VcsRevision::RevisionSpecialType>()==VcsRevision::Start) //if we want it to the begining just put the revisionInterval
else if(rev.revisionType()==VcsRevision::Special) ret = toRevisionName(limit, QString());
ret = toRevisionName(limit, srcRevisionName); else {
else QString dstRevisionName = toRevisionName(limit);
ret = toRevisionName(limit, srcRevisionName)+".." +srcRevisionName; ret = toRevisionName(rev, dstRevisionName)+".."+dstRevisionName;
}
// qDebug() << "=======>" << ret;
return ret; return ret;
} }
...@@ -358,7 +360,10 @@ VcsJob* GitPlugin::log(const KUrl& localLocation, ...@@ -358,7 +360,10 @@ VcsJob* GitPlugin::log(const KUrl& localLocation,
const KDevelop::VcsRevision& src, const KDevelop::VcsRevision& dst) const KDevelop::VcsRevision& src, const KDevelop::VcsRevision& dst)
{ {
DVcsJob* job = new GitJob(dotGitDirectory(localLocation), this); DVcsJob* job = new GitJob(dotGitDirectory(localLocation), this);
*job << "git" << "log" << revisionInterval(src, dst) << "--date=raw"; *job << "git" << "log" << "--date=raw";
QString rev = revisionInterval(dst, src);
if(!rev.isEmpty())
*job << rev;
*job << "--" << localLocation; *job << "--" << localLocation;
connect(job, SIGNAL(readyForParsing(KDevelop::DVcsJob*)), this, SLOT(parseGitLogOutput(KDevelop::DVcsJob*))); connect(job, SIGNAL(readyForParsing(KDevelop::DVcsJob*)), this, SLOT(parseGitLogOutput(KDevelop::DVcsJob*)));
return job; return job;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment