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
case VcsRevision::Head:
return "^HEAD";
case VcsRevision::Base:
return "HEAD";
return "";
case VcsRevision::Working:
return "";
case VcsRevision::Previous:
......@@ -124,15 +124,17 @@ QString toRevisionName(const KDevelop::VcsRevision& rev, QString currentRevision
QString revisionInterval(const KDevelop::VcsRevision& rev, const KDevelop::VcsRevision& limit)
{
QString ret;
QString srcRevisionName = toRevisionName(rev);
if(limit.revisionType()==VcsRevision::Special &&
limit.revisionValue().value<VcsRevision::RevisionSpecialType>()==VcsRevision::Start) //if we want it to the begining just put the revisionInterval
return ret = srcRevisionName;
else if(rev.revisionType()==VcsRevision::Special)
ret = toRevisionName(limit, srcRevisionName);
else
ret = toRevisionName(limit, srcRevisionName)+".." +srcRevisionName;
// qDebug() << "prrrrrrrrrr" << toRevisionName(rev, "xxx") << toRevisionName(limit, "yyy");
if(rev.revisionType()==VcsRevision::Special &&
rev.revisionValue().value<VcsRevision::RevisionSpecialType>()==VcsRevision::Start) //if we want it to the begining just put the revisionInterval
ret = toRevisionName(limit, QString());
else {
QString dstRevisionName = toRevisionName(limit);
ret = toRevisionName(rev, dstRevisionName)+".."+dstRevisionName;
}
// qDebug() << "=======>" << ret;
return ret;
}
......@@ -358,7 +360,10 @@ VcsJob* GitPlugin::log(const KUrl& localLocation,
const KDevelop::VcsRevision& src, const KDevelop::VcsRevision& dst)
{
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;
connect(job, SIGNAL(readyForParsing(KDevelop::DVcsJob*)), this, SLOT(parseGitLogOutput(KDevelop::DVcsJob*)));
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