• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdevelop API Reference
  • KDE Home
  • Contact Us
 

kdevplatform/vcs

  • KDevelop
  • IBasicVersionControl
Public Types | Public Member Functions | List of all members
KDevelop::IBasicVersionControl Class Referenceabstract

#include <ibasicversioncontrol.h>

Inheritance diagram for KDevelop::IBasicVersionControl:
Inheritance graph
[legend]

Public Types

enum  RecursionMode { Recursive, NonRecursive }
 

Public Member Functions

virtual ~IBasicVersionControl ()
 
virtual VcsJob * add (const QList< QUrl > &localLocations, RecursionMode recursion=IBasicVersionControl::Recursive)=0
 
virtual VcsJob * annotate (const QUrl &localLocation, const VcsRevision &rev=VcsRevision::createSpecialRevision(VcsRevision::Head))=0
 
virtual VcsJob * commit (const QString &message, const QList< QUrl > &localLocations, RecursionMode recursion=IBasicVersionControl::Recursive)=0
 
virtual VcsJob * copy (const QUrl &localLocationSrc, const QUrl &localLocationDstn)=0
 
virtual VcsImportMetadataWidget * createImportMetadataWidget (QWidget *parent)=0
 
virtual VcsJob * createWorkingCopy (const VcsLocation &sourceRepository, const QUrl &destinationDirectory, RecursionMode recursion=IBasicVersionControl::Recursive)=0
 
virtual VcsJob * diff (const QUrl &fileOrDirectory, const VcsRevision &srcRevision, const VcsRevision &dstRevision, IBasicVersionControl::RecursionMode recursion=IBasicVersionControl::Recursive)=0
 
virtual bool isValidRemoteRepositoryUrl (const QUrl &remoteLocation)=0
 
virtual bool isVersionControlled (const QUrl &localLocation)=0
 
virtual VcsJob * log (const QUrl &localLocation, const VcsRevision &rev, unsigned long limit=0)=0
 
virtual VcsJob * log (const QUrl &localLocation, const VcsRevision &rev=VcsRevision::createSpecialRevision(VcsRevision::Base), const VcsRevision &limit=VcsRevision::createSpecialRevision(VcsRevision::Start))=0
 
virtual VcsJob * move (const QUrl &localLocationSrc, const QUrl &localLocationDst)=0
 
virtual QString name () const =0
 
virtual VcsJob * remove (const QList< QUrl > &localLocations)=0
 
virtual VcsJob * repositoryLocation (const QUrl &localLocation)=0
 
virtual VcsJob * resolve (const QList< QUrl > &localLocations, RecursionMode recursion)=0
 
virtual VcsJob * revert (const QList< QUrl > &localLocations, RecursionMode recursion=IBasicVersionControl::Recursive)=0
 
virtual void setupCommitMessageEditor (const QUrl &, KTextEdit *edit) const
 
virtual VcsJob * status (const QList< QUrl > &localLocations, RecursionMode recursion=IBasicVersionControl::Recursive)=0
 
virtual VcsJob * update (const QList< QUrl > &localLocations, const VcsRevision &rev=VcsRevision::createSpecialRevision(VcsRevision::Head), RecursionMode recursion=IBasicVersionControl::Recursive)=0
 
virtual VcsLocationWidget * vcsLocation (QWidget *parent) const =0
 

Detailed Description

This is the basic interface that all Version Control or Source Code Management plugins need to implement.

None of the methods in this interface are optional.

This only works on a local checkout from the repository, if your plugin should offer functionality that works solely on the server see the IRepositoryVersionControl interface

Definition at line 52 of file ibasicversioncontrol.h.

Member Enumeration Documentation

◆ RecursionMode

enum KDevelop::IBasicVersionControl::RecursionMode
Enumerator
Recursive 

run recursively through subdirectories

NonRecursive 

don't run recursively through subdirectories

Definition at line 56 of file ibasicversioncontrol.h.

Constructor & Destructor Documentation

◆ ~IBasicVersionControl()

virtual KDevelop::IBasicVersionControl::~IBasicVersionControl ( )
inlinevirtual

Definition at line 61 of file ibasicversioncontrol.h.

Member Function Documentation

◆ add()

virtual VcsJob* KDevelop::IBasicVersionControl::add ( const QList< QUrl > &  localLocations,
RecursionMode  recursion = IBasicVersionControl::Recursive 
)
pure virtual

adds a local unversioned file or directory to the list of versioned files.

Parameters
localLocationsa list of files or directories that should be put under version control
recursionwhether to add directories and their children or only directories themselves
Returns
a job that executes the addition

◆ annotate()

virtual VcsJob* KDevelop::IBasicVersionControl::annotate ( const QUrl &  localLocation,
const VcsRevision &  rev = VcsRevision::createSpecialRevision(VcsRevision::Head) 
)
pure virtual

Annotate each line of the given local url at the given revision with information about who changed it and when.

The job should return a QList<QVariant> where the QVariant wraps a KDevelop::VcsAnnotationLine. The instance contains all information needed for the caller to construct a KDevelop::VcsAnnotation

See also
KDevelop::VcsAnnotation
KDevelop::VcsAnnotationLine
Parameters
localLocationlocal file that should be annotated.
revRevision that should be annotated.

◆ commit()

virtual VcsJob* KDevelop::IBasicVersionControl::commit ( const QString &  message,
const QList< QUrl > &  localLocations,
RecursionMode  recursion = IBasicVersionControl::Recursive 
)
pure virtual

Checks in the changes of the given file(s)/dir(s) into the repository.

◆ copy()

virtual VcsJob* KDevelop::IBasicVersionControl::copy ( const QUrl &  localLocationSrc,
const QUrl &  localLocationDstn 
)
pure virtual

executes a copy of a file/dir, preserving history if the VCS system allows that, may be implemented by filesystem copy+add

◆ createImportMetadataWidget()

virtual VcsImportMetadataWidget* KDevelop::IBasicVersionControl::createImportMetadataWidget ( QWidget *  parent)
pure virtual

provides a widget that fetches the needed input data from the user to import a project into a version control system.

If this returns 0 the plugin will not be available as an option for import when creating a new project

Parameters
parentthe parent widget for the newly created widget
Returns
a widget to fetch metadata needed to import a project

Implemented in KDevelop::DistributedVersionControlPlugin.

◆ createWorkingCopy()

virtual VcsJob* KDevelop::IBasicVersionControl::createWorkingCopy ( const VcsLocation &  sourceRepository,
const QUrl &  destinationDirectory,
RecursionMode  recursion = IBasicVersionControl::Recursive 
)
pure virtual

Creates a working copy of the latest revision of the repository sourceRepository in the newly created directory destinationDirectory.

In the case of a decentralized VCSs, there is no working copy without repository, therefor checkout() includes the creation of a local copy of the repository.

Parameters
sourceRepositorysource of the checkout
destinationDirectorylocation of the created working copy (local repository)

◆ diff()

virtual VcsJob* KDevelop::IBasicVersionControl::diff ( const QUrl &  fileOrDirectory,
const VcsRevision &  srcRevision,
const VcsRevision &  dstRevision,
IBasicVersionControl::RecursionMode  recursion = IBasicVersionControl::Recursive 
)
pure virtual

Retrieves a diff between two revisions of a file.

The diff is in unified diff format for text files.

◆ isValidRemoteRepositoryUrl()

virtual bool KDevelop::IBasicVersionControl::isValidRemoteRepositoryUrl ( const QUrl &  remoteLocation)
pure virtual

Checks whether the given remoteLocation is a valid remote repository URL.

If the URL is a local filesystem path, the folder will be checked if it contains proper repository content. For non-local filesystem URLs only the URL properties will be checked, no communication to any server is done.

Parameters
remoteLocationthe URL used to access a remote repository
Returns
true if the given remoteLocation seems valid for this version control system

◆ isVersionControlled()

virtual bool KDevelop::IBasicVersionControl::isVersionControlled ( const QUrl &  localLocation)
pure virtual

These methods rely on a valid vcs-directory with vcs-metadata in it.

revisions can contain a date in format parseable by QDate, a number, or the special words HEAD and BASE (whose exact meaning depends on the used VCS system) Is the given localLocation under version control? This checks whether the localLocation is under control of the versioning system or not. It does not only check whether the localLocation lies in a version controlled directory

Returns
true if the version control system knows the given localLocation

◆ log() [1/2]

virtual VcsJob* KDevelop::IBasicVersionControl::log ( const QUrl &  localLocation,
const VcsRevision &  rev,
unsigned long  limit = 0 
)
pure virtual

Retrieve the history of a given local url.

The resulting VcsJob will emit the resultsReady signal every time new log events are available. The fetchResults method will return a QList<QVariant> where the QVariant is a KDevelop::VcsEvent.

Parameters
revList rev and earlier.
limitRestrict to the most recent limit entries. Note that the limit is advisory and may be ignored.

◆ log() [2/2]

virtual VcsJob* KDevelop::IBasicVersionControl::log ( const QUrl &  localLocation,
const VcsRevision &  rev = VcsRevision::createSpecialRevision(VcsRevision::Base),
const VcsRevision &  limit = VcsRevision::createSpecialRevision(VcsRevision::Start) 
)
pure virtual

Retrieve the history of a given local url.

The resulting VcsJob will emit the resultsReady signal every time new log events are available. The fetchResults method will return a QList<QVariant> where the QVariant is a KDevelop::VcsEvent.

Parameters
revList rev and earlier. The default is BASE.
limitDo not show entries earlier than limit. Note that the limit is advisory and may be ignored. The default is the first revision.

◆ move()

virtual VcsJob* KDevelop::IBasicVersionControl::move ( const QUrl &  localLocationSrc,
const QUrl &  localLocationDst 
)
pure virtual

moves src to dst, preserving history if the VCS system allows that, may be implemented by copy+remove

◆ name()

virtual QString KDevelop::IBasicVersionControl::name ( ) const
pure virtual

return a user-visible string for the version control plugin Can be used for example when importing a project into a version control system to choose the appropriate system

Returns
a translated user-visible name for this version control plugin

◆ remove()

virtual VcsJob* KDevelop::IBasicVersionControl::remove ( const QList< QUrl > &  localLocations)
pure virtual

removes a local versioned file or directory from the version control system

Parameters
localLocationsthe list of files/directories to remove from the VCS
Returns
a job that executes the removal

◆ repositoryLocation()

virtual VcsJob* KDevelop::IBasicVersionControl::repositoryLocation ( const QUrl &  localLocation)
pure virtual

Get the repository location of a local file.

◆ resolve()

virtual VcsJob* KDevelop::IBasicVersionControl::resolve ( const QList< QUrl > &  localLocations,
RecursionMode  recursion 
)
pure virtual

check for conflicts in the given file and eventually present a conflict solving dialog to the user

◆ revert()

virtual VcsJob* KDevelop::IBasicVersionControl::revert ( const QList< QUrl > &  localLocations,
RecursionMode  recursion = IBasicVersionControl::Recursive 
)
pure virtual

revert all local changes on the given file, making its content equal to the version in the repository unedit() (if not a no-op) is implied.

◆ setupCommitMessageEditor()

void KDevelop::IBasicVersionControl::setupCommitMessageEditor ( const QUrl &  ,
KTextEdit *  edit 
) const
virtual

Optionally apply VCS specific settings to the commit message editor.

Default empty implementation.

Overwrite this to set e.g. a default commit message or to setup highlighting or validation. The default implementation does nothing.

Definition at line 24 of file ibasicversioncontrol.cpp.

◆ status()

virtual VcsJob* KDevelop::IBasicVersionControl::status ( const QList< QUrl > &  localLocations,
RecursionMode  recursion = IBasicVersionControl::Recursive 
)
pure virtual

Fetches the status of the given local vcs locations.

The returned VcsJob populates a QList<QVariant> that can be fetched using fetchResults(). The QVariant inside the list wraps a KDevelo::VcsStatusInfo object which contains all the relevant information about the status of a specific file or folder

◆ update()

virtual VcsJob* KDevelop::IBasicVersionControl::update ( const QList< QUrl > &  localLocations,
const VcsRevision &  rev = VcsRevision::createSpecialRevision(VcsRevision::Head),
RecursionMode  recursion = IBasicVersionControl::Recursive 
)
pure virtual

fetches the latest changes from the repository, if there are conflicts a merge needs to be executed separately

Parameters
localLocationsthe local files/dirs that should be updated
revUpdate to this revision. The operation will fail if rev is a range.
recursiondefines whether the directories should be updated recursively

◆ vcsLocation()

virtual VcsLocationWidget* KDevelop::IBasicVersionControl::vcsLocation ( QWidget *  parent) const
pure virtual

The documentation for this class was generated from the following files:
  • ibasicversioncontrol.h
  • ibasicversioncontrol.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Tue Jan 19 2021 23:37:34 by doxygen 1.8.16 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kdevplatform/vcs

Skip menu "kdevplatform/vcs"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdevelop API Reference

Skip menu "kdevelop API Reference"
  • kdevplatform
  •   debugger
  •   documentation
  •   interfaces
  •   language
  •     assistant
  •     backgroundparser
  •     checks
  •     classmodel
  •     codecompletion
  •     codegen
  •     duchain
  •     editor
  •     highlighting
  •     interfaces
  •     util
  •   outputview
  •   project
  •   serialization
  •   shell
  •   sublime
  •   tests
  •   util
  •   vcs

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal