summaryrefslogtreecommitdiffstats
path: root/vcs/subversion/integrator
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commit114a878c64ce6f8223cfd22d76a20eb16d177e5e (patch)
treeacaf47eb0fa12142d3896416a69e74cbf5a72242 /vcs/subversion/integrator
downloadtdevelop-114a878c64ce6f8223cfd22d76a20eb16d177e5e.tar.gz
tdevelop-114a878c64ce6f8223cfd22d76a20eb16d177e5e.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'vcs/subversion/integrator')
-rw-r--r--vcs/subversion/integrator/Makefile.am14
-rw-r--r--vcs/subversion/integrator/kdevsubversionintegrator.desktop45
-rw-r--r--vcs/subversion/integrator/subversionintegrator.cpp54
-rw-r--r--vcs/subversion/integrator/subversionintegrator.h39
-rw-r--r--vcs/subversion/integrator/svnintegratordlg.cpp122
-rw-r--r--vcs/subversion/integrator/svnintegratordlg.h39
-rw-r--r--vcs/subversion/integrator/svnintegratordlgbase.ui190
7 files changed, 503 insertions, 0 deletions
diff --git a/vcs/subversion/integrator/Makefile.am b/vcs/subversion/integrator/Makefile.am
new file mode 100644
index 00000000..a0fe82cd
--- /dev/null
+++ b/vcs/subversion/integrator/Makefile.am
@@ -0,0 +1,14 @@
+INCLUDES = -I$(top_srcdir)/lib/interfaces \
+ -I$(top_srcdir)/lib/interfaces/extensions -I$(top_srcdir)/lib/interfaces/extras -I$(top_srcdir)/lib/util \
+ $(all_includes)
+METASOURCES = AUTO
+
+kde_module_LTLIBRARIES = libsubversionintegrator.la
+libsubversionintegrator_la_LDFLAGS = -avoid-version -no-undefined $(all_libraries)
+libsubversionintegrator_la_LIBADD =\
+ $(top_builddir)/lib/interfaces/extras/libkdevextras.la\
+ $(top_builddir)/lib/libkdevelop.la
+kde_services_DATA = kdevsubversionintegrator.desktop
+noinst_HEADERS = subversionintegrator.h svnintegratordlg.h
+libsubversionintegrator_la_SOURCES = subversionintegrator.cpp \
+ svnintegratordlgbase.ui svnintegratordlg.cpp
diff --git a/vcs/subversion/integrator/kdevsubversionintegrator.desktop b/vcs/subversion/integrator/kdevsubversionintegrator.desktop
new file mode 100644
index 00000000..4b3a1c1c
--- /dev/null
+++ b/vcs/subversion/integrator/kdevsubversionintegrator.desktop
@@ -0,0 +1,45 @@
+[Desktop Entry]
+Type=Service
+Name=KDevSubversionIntegrator
+Name[da]=KDevelop Subversion-integration
+Name[nds]=KDevelop-Subversion-Integreren
+Name[sk]=KDev Subversion integrácia
+Name[sv]=KDevelop Subversion-integration
+Name[zh_TW]=KDevelop Subversion 整合器
+Comment=Subversion Project Integration Facility
+Comment[ca]=Facilitat per a la integració amb Subversion
+Comment[da]=Subversion projektintegration
+Comment[de]=Subversion-Projektintegration
+Comment[el]=Λειτουργία ενσωμάτωσης Subversion στο έργο
+Comment[es]=Facilidad para integración con proyectos que utilicen Subversion
+Comment[et]=Subversion projekti põimimisvahend
+Comment[eu]=Subversion proiektuen integrazio-tesna
+Comment[fa]=تسهیلات مجتمع‌سازی پروژۀ زیرنسخه
+Comment[fr]=Fonction d'intégration pour un projet utilisant Subversion
+Comment[gl]=Utilidade para a integración de proxectos Subversión
+Comment[hu]=Projektintegrálást tesz lehetővé a Subversion-nel
+Comment[it]=Funzione di integrazione del progetto Subversion
+Comment[ja]=Subversion プロジェクト統合ツール
+Comment[ms]=Kemudahan Integrasi Projek Subversion
+Comment[nds]=Subversion-Projektintegreren
+Comment[ne]=सबभर्सन परियोजना एकिकरण सुविधा
+Comment[nl]=Subversion project-integratie
+Comment[pl]=Integracja z Subversion
+Comment[pt]=Integração com Projectos Subversion
+Comment[pt_BR]=Facilidade de Integração ao Projeto de Subversão
+Comment[ru]=Интеграция Subversion
+Comment[sk]=Subversion projektová integrácia
+Comment[sr]=Интеграција Subversion-а у пројекат
+Comment[sr@Latn]=Integracija Subversion-a u projekat
+Comment[sv]=Funktion för integrering av Subversion i projekt
+Comment[tr]=Subversion Proje Bütünleştirme Aracı
+Comment[zh_CN]=Subversion 工程集成功能
+Comment[zh_TW]=Subversion 專案整合工具
+Icon=misc
+Exec=blubb
+ServiceTypes=KDevelop/VCSIntegrator
+X-KDE-Library=libsubversionintegrator
+X-KDevelop-Default=false
+X-KDevelop-VCS=Subversion
+X-KDevelop-VCSPlugin=kdevsubversion
+X-KDevelop-Version=5
diff --git a/vcs/subversion/integrator/subversionintegrator.cpp b/vcs/subversion/integrator/subversionintegrator.cpp
new file mode 100644
index 00000000..65bf1a78
--- /dev/null
+++ b/vcs/subversion/integrator/subversionintegrator.cpp
@@ -0,0 +1,54 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "subversionintegrator.h"
+
+#include <kdevgenericfactory.h>
+#include <kdevplugininfo.h>
+
+#include "svnintegratordlg.h"
+
+static const KDevPluginInfo data("kdevsubversionintegrator");
+typedef KDevGenericFactory<SubversionIntegrator> SubversionIntegratorFactory;
+K_EXPORT_COMPONENT_FACTORY( libsubversionintegrator, SubversionIntegratorFactory(data) )
+
+SubversionIntegrator::SubversionIntegrator(QObject* parent, const char* name,
+ const QStringList // args
+ )
+ :KDevVCSIntegrator(parent, name)
+{
+}
+
+SubversionIntegrator::~SubversionIntegrator()
+{
+}
+
+VCSDialog* SubversionIntegrator::fetcher(QWidget* // parent
+ )
+{
+ return 0;
+}
+
+VCSDialog* SubversionIntegrator::integrator(QWidget* parent)
+{
+ SvnIntegratorDlg *dlg = new SvnIntegratorDlg(parent);
+ return dlg;
+}
+
+#include "subversionintegrator.moc"
diff --git a/vcs/subversion/integrator/subversionintegrator.h b/vcs/subversion/integrator/subversionintegrator.h
new file mode 100644
index 00000000..e58c7786
--- /dev/null
+++ b/vcs/subversion/integrator/subversionintegrator.h
@@ -0,0 +1,39 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef SUBVERSIONINTEGRATOR_H
+#define SUBVERSIONINTEGRATOR_H
+
+#include <kdevvcsintegrator.h>
+
+#include <qstringlist.h>
+
+class SubversionIntegrator : public KDevVCSIntegrator
+{
+Q_OBJECT
+public:
+ SubversionIntegrator(QObject* parent, const char* name, const QStringList args = QStringList());
+ ~SubversionIntegrator();
+
+ virtual VCSDialog* fetcher(QWidget* parent);
+ virtual VCSDialog* integrator(QWidget* parent);
+
+};
+
+#endif
diff --git a/vcs/subversion/integrator/svnintegratordlg.cpp b/vcs/subversion/integrator/svnintegratordlg.cpp
new file mode 100644
index 00000000..9d271a90
--- /dev/null
+++ b/vcs/subversion/integrator/svnintegratordlg.cpp
@@ -0,0 +1,122 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * Copyright (C) 2004 *
+ * Mickael Marchand <marchand@kde.org> *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "svnintegratordlg.h"
+#include "blockingkprocess.h"
+#include <kurl.h>
+#include <kio/jobclasses.h>
+#include <kio/job.h>
+#include <kurlrequester.h>
+#include <kdebug.h>
+#include <qradiobutton.h>
+#include <kio/scheduler.h>
+#include <kprocess.h>
+#include <kdeversion.h>
+#include <kmessagebox.h>
+#include <klocale.h>
+#include <kdebug.h>
+
+#include <kio/netaccess.h>
+
+using namespace KIO;
+
+SvnIntegratorDlg::SvnIntegratorDlg( QWidget *parent, const char *name )
+ : SvnIntegratorDlgBase( parent, name )
+{
+ repos1->setMode( KFile::Directory );
+}
+
+void SvnIntegratorDlg::accept()
+{
+ // to let ioslave know which protocol it should start.
+ KURL protocolUrl = KURL("kdevsvn+svn://blah/");
+ KURL servURL( repos1->url() );
+ if ( servURL.isEmpty() ) return;
+
+ kdDebug( 9036 ) << "servURL : " << servURL.prettyURL() << endl;
+ if ( createProject->isChecked() )
+ {
+ KURL::List list;
+ list << servURL; // project root directory
+ KURL miscURL = servURL.url();
+ miscURL.setPath( servURL.path() + "/tags/" );
+ list << miscURL;
+ miscURL.setPath( servURL.path() + "/branches/" );
+ list << miscURL;
+ miscURL.setPath( servURL.path() + "/trunk/" );
+ list << miscURL;
+
+ QByteArray parms;
+ QDataStream s( parms, IO_WriteOnly );
+ int cmd = 10; // MKDIR(list)
+ s << cmd << list;
+ KIO::SimpleJob* job = KIO::special( protocolUrl, parms, true );
+ if( !NetAccess::synchronousRun( job, 0 ) ){
+ KMessageBox::error( this, i18n("Unable to create project directories on repository") );
+ return;
+ }
+
+ QByteArray parms2;
+ QDataStream s2( parms2, IO_WriteOnly );
+ cmd = 5; //IMPORT
+ servURL.setPath( servURL.path() + "/trunk/" );
+ s2 << cmd << servURL << KURL::fromPathOrURL( m_projectLocation );
+ KIO::SimpleJob* importJob = KIO::special( protocolUrl, parms2, true );
+ if( !NetAccess::synchronousRun( importJob, 0 ) ){
+ KMessageBox::error( this, i18n("Unable to import into repository.") );
+ return;
+ }
+ }
+ //delete the template directory and checkout a fresh one from the server
+ BlockingKProcess *rmproc = new BlockingKProcess();
+ *rmproc << "rm";
+ *rmproc << "-f" << "-r" << m_projectLocation;
+ rmproc->start();
+
+ delete rmproc;
+ rmproc = NULL;
+
+ QByteArray parms3;
+ QDataStream s3( parms3, IO_WriteOnly );
+ int cmd2 = 1; //CHECKOUT
+ int rev = -1;
+
+ s3 << cmd2 << servURL << KURL::fromPathOrURL( m_projectLocation ) << rev << QString( "HEAD" );
+ SimpleJob *job2 = KIO::special( protocolUrl, parms3, true );
+ if( ! NetAccess::synchronousRun( job2, 0 ) ){
+ // Checkout failed
+ KMessageBox::error(this, i18n("Unable to checkout from repository.") );
+ return;
+ }
+}
+
+void SvnIntegratorDlg::init( const QString &projectName, const QString &projectLocation )
+{
+ m_name = projectName;
+ m_projectLocation = projectLocation;
+}
+
+QWidget *SvnIntegratorDlg::self()
+{
+ return const_cast<SvnIntegratorDlg*>( this );
+}
+
+#include "svnintegratordlg.moc"
diff --git a/vcs/subversion/integrator/svnintegratordlg.h b/vcs/subversion/integrator/svnintegratordlg.h
new file mode 100644
index 00000000..c68ee256
--- /dev/null
+++ b/vcs/subversion/integrator/svnintegratordlg.h
@@ -0,0 +1,39 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef SVNINTEGRATORDLG_H
+#define SVNINTEGRATORDLG_H
+
+#include "svnintegratordlgbase.h"
+#include <kdevvcsintegrator.h>
+
+class SvnIntegratorDlg: public SvnIntegratorDlgBase, public VCSDialog {
+Q_OBJECT
+public:
+ SvnIntegratorDlg(QWidget *parent = 0, const char *name = 0);
+
+ virtual void accept();
+ virtual void init(const QString &projectName, const QString &projectLocation);
+ virtual QWidget *self();
+private:
+ QString m_name;
+ QString m_projectLocation;
+};
+
+#endif
diff --git a/vcs/subversion/integrator/svnintegratordlgbase.ui b/vcs/subversion/integrator/svnintegratordlgbase.ui
new file mode 100644
index 00000000..a2ec9982
--- /dev/null
+++ b/vcs/subversion/integrator/svnintegratordlgbase.ui
@@ -0,0 +1,190 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>SvnIntegratorDlgBase</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>SvnIntegratorDlgBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>648</width>
+ <height>429</height>
+ </rect>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="QButtonGroup" row="0" column="0">
+ <property name="name">
+ <cstring>buttonGroup1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="frameShape">
+ <enum>NoFrame</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Sunken</enum>
+ </property>
+ <property name="title">
+ <string></string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>doNothing</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Do not do anything</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Adds subversion menus to project.
+
+NOTE: Unless you import the project
+out of kdevelop, you will not be able
+to perform any subversion operations.</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Adds subversion menus to project.
+
+NOTE: Unless you import the project
+out of kdevelop, you will not be able
+to perform any subversion operations.</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>createProject</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Create a project tree and import new project into trunk, then checkout from the repository</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Creates project, imports it into the subversion
+repository and checks it out as a working copy.
+
+NOTE: The repository has to exist.
+e.g. has been created with 'svnadmin'</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Creates project, imports it into the subversion
+repository and checks it out as a working copy.
+
+NOTE: The repository has to exist.
+e.g. has been created with 'svnadmin'</string>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Example for the url (if /home/user/subversion is the subversion repository):
+file:///home/user/subversion/mynewproject</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout5</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>repositoryLabel1</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Repository:</string>
+ </property>
+ </widget>
+ <widget class="KURLRequester">
+ <property name="name">
+ <cstring>repos1</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Subversion repository location.
+The repository has to exist -
+e.g. has been created with 'svnadmin'</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Subversion repository location. This should include the subdirectory for the project in the repository. The project subdirectory and further subdirectories will be created.
+
+So for example if you give http://localhost/svn/projectname the following directories will be created and the project imported into the trunk subdirectory:
+http://localhost/svn/projectname
+http://localhost/svn/projectname/tags
+http://localhost/svn/projectname/branches
+http://localhost/svn/projectname/trunk</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer9</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>21</width>
+ <height>131</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>createProject</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>repositoryLabel1</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>createProject</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>repos1</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+</connections>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>kurlrequester.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+</includehints>
+</UI>