[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kdevplatform] plugins/git: Set the type for the vcs jobs,
From:       Aleix Pol <aleixpol () kde ! org>
Date:       2011-08-12 10:26:57
Message-ID: 20110812102657.911C4A60B9 () git ! kde ! org
[Download RAW message or body]

Git commit 912e3326b6fad1fd979fc4be3c639bfa40fa85a2 by Aleix Pol.
Committed on 12/08/2011 at 12:26.
Pushed by apol into branch 'master'.

Set the type for the vcs jobs, for better integration.

M  +10   -0    plugins/git/gitplugin.cpp
M  +3    -1    plugins/git/gitjob.cpp

http://commits.kde.org/kdevplatform/912e3326b6fad1fd979fc4be3c639bfa40fa85a2

diff --git a/plugins/git/gitjob.cpp b/plugins/git/gitjob.cpp
index 6c10254..214e12a 100644
--- a/plugins/git/gitjob.cpp
+++ b/plugins/git/gitjob.cpp
@@ -25,4 +25,6 @@
 
 GitJob::GitJob(const QDir& workingDir, KDevelop::IPlugin* parent, \
KDevelop::OutputJob::OutputJobVerbosity verbosity)  : DVcsJob(workingDir, parent, \
                verbosity)
-{}
+{
+    setType(VcsJob::UserType);
+}
diff --git a/plugins/git/gitplugin.cpp b/plugins/git/gitplugin.cpp
index 9caa249..3e908f2 100644
--- a/plugins/git/gitplugin.cpp
+++ b/plugins/git/gitplugin.cpp
@@ -282,6 +282,7 @@ bool GitPlugin::isVersionControlled(const KUrl &path)
 VcsJob* GitPlugin::init(const KUrl &directory)
 {
     DVcsJob* job = new DVcsJob(urlDir(directory), this);
+    job->setType(VcsJob::Import);
     *job << "git" << "init";
     return job;
 }
@@ -289,6 +290,7 @@ VcsJob* GitPlugin::init(const KUrl &directory)
 VcsJob* GitPlugin::createWorkingCopy(const KDevelop::VcsLocation & source, const \
KUrl& dest, KDevelop::IBasicVersionControl::RecursionMode)  {
     DVcsJob* job = new GitCloneJob(urlDir(dest), this);
+    job->setType(VcsJob::Import);
     *job << "git" << "clone" << "--progress" << "--" << source.localUrl().url() << \
dest;  return job;
 }
@@ -309,6 +311,7 @@ KDevelop::VcsJob* GitPlugin::status(const KUrl::List& \
                localLocations, KDevelop::
         return errorsFound(i18n("Did not specify the list of files"), \
OutputJob::Verbose);  
     DVcsJob* job = new GitJob(urlDir(localLocations), this, OutputJob::Silent);
+    job->setType(VcsJob::Status);
     
     if(m_oldVersion) {
         *job << "git" << "ls-files" << "-t" << "-m" << "-c" << "-o" << "-d" << "-k" \
<< "--directory"; @@ -328,6 +331,7 @@ VcsJob* GitPlugin::diff(const KUrl& \
fileOrDirectory, const KDevelop::VcsRevision  //TODO: control different types
     
     DVcsJob* job = new GitJob(dotGitDirectory(fileOrDirectory), this, \
KDevelop::OutputJob::Silent); +    job->setType(VcsJob::Diff);
     *job << "git" << "diff" << "--no-prefix" << "--no-color" << "--no-ext-diff";
     QString revstr = revisionInterval(srcRevision, dstRevision);
     if(!revstr.isEmpty())
@@ -345,6 +349,7 @@ VcsJob* GitPlugin::revert(const KUrl::List& localLocations, \
                IBasicVersionControl
         return errorsFound(i18n("Could not revert changes"), OutputJob::Verbose);
     
     DVcsJob* job = new GitJob(dotGitDirectory(localLocations.front()), this);
+    job->setType(VcsJob::Revert);
     *job << "git" << "checkout" << "--";
     *job << (recursion == IBasicVersionControl::Recursive ? localLocations : \
preventRecursion(localLocations));  
@@ -363,6 +368,7 @@ VcsJob* GitPlugin::commit(const QString& message,
 
     QDir dir = dotGitDirectory(localLocations.front());
     DVcsJob* job = new DVcsJob(dir, this);
+    job->setType(VcsJob::Commit);
     KUrl::List files = (recursion == IBasicVersionControl::Recursive ? \
localLocations : preventRecursion(localLocations));  addNotVersionedFiles(dir, \
files);  
@@ -404,6 +410,7 @@ VcsJob* GitPlugin::remove(const KUrl::List& files)
     QStringList otherStr = getLsFiles(dir, QStringList() << "--others" << "--" << \
files.front().toLocalFile(), KDevelop::OutputJob::Silent);  if(otherStr.isEmpty()) {
         DVcsJob* job = new GitJob(dir, this);
+        job->setType(VcsJob::Remove);
         *job << "git" << "rm" << "-r";
         *job << "--" << files;
         return job;
@@ -416,6 +423,7 @@ VcsJob* GitPlugin::log(const KUrl& localLocation,
                 const KDevelop::VcsRevision& src, const KDevelop::VcsRevision& dst)
 {
     DVcsJob* job = new GitJob(dotGitDirectory(localLocation), this, \
KDevelop::OutputJob::Silent); +    job->setType(VcsJob::Log);
     *job << "git" << "log" << "--date=raw" /*<< "--numstat"*/;
     QString rev = revisionInterval(dst, src);
     if(!rev.isEmpty())
@@ -429,6 +437,7 @@ VcsJob* GitPlugin::log(const KUrl& localLocation,
 VcsJob* GitPlugin::log(const KUrl& localLocation, const KDevelop::VcsRevision& rev, \
unsigned long int limit)  {
     DVcsJob* job = new GitJob(dotGitDirectory(localLocation), this, \
KDevelop::OutputJob::Silent); +    job->setType(VcsJob::Log);
     *job << "git" << "log" << "--date=raw" /*<< "--numstat"*/ << toRevisionName(rev, \
QString());  if(limit>0)
         *job << QString("-%1").arg(limit);
@@ -441,6 +450,7 @@ VcsJob* GitPlugin::log(const KUrl& localLocation, const \
KDevelop::VcsRevision& r  KDevelop::VcsJob* GitPlugin::annotate(const KUrl \
&localLocation, const KDevelop::VcsRevision&)  {
     DVcsJob* job = new GitJob(dotGitDirectory(localLocation), this, \
KDevelop::OutputJob::Silent); +    job->setType(VcsJob::Annotate);
     *job << "git" << "blame" << "--porcelain";
     *job << "--" << localLocation;
     connect(job, SIGNAL(readyForParsing(KDevelop::DVcsJob*)), this, \
SLOT(parseGitBlameOutput(KDevelop::DVcsJob*)));


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic