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

List:       kde-commits
Subject:    KDE/kdevplatform/plugins [POSSIBLY UNSAFE]
From:       Tom Burdick <tburdi1 () uic ! edu>
Date:       2008-07-10 1:30:37
Message-ID: 1215653437.452792.26768.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 830263 by tburdick:

Renamed and modified git files to be mercurial/hg files


 M  +2 -0      CMakeLists.txt  
 M  +13 -13    mercurial/CMakeLists.txt  
 D             mercurial/gitgenericoutputview.cpp  
 D             mercurial/gitgenericoutputview.h  
 D             mercurial/gitjob.cpp  
 D             mercurial/gitjob.h  
 D             mercurial/gitmainview.cpp  
 D             mercurial/gitmainview.h  
 D             mercurial/gitplugin.cpp  
 D             mercurial/gitplugin.h  
 D             mercurial/gitproxy.cpp  
 D             mercurial/gitproxy.h  
 A             mercurial/hggenericoutputview.cpp   \
mercurial/gitgenericoutputview.cpp#830214 [License: GPL (v2/3)]  A             \
mercurial/hggenericoutputview.h   mercurial/gitgenericoutputview.h#830214 [License: \
GPL (v2/3)]  A             mercurial/hgjob.cpp   mercurial/gitjob.cpp#830214 \
[License: GPL (v2/3)]  A             mercurial/hgjob.h   mercurial/gitjob.h#830214 \
[License: GPL (v2/3)]  A             mercurial/hgmainview.cpp   \
mercurial/gitmainview.cpp#830214 [License: GPL (v2/3)]  A             \
mercurial/hgmainview.h   mercurial/gitmainview.h#830214 [License: GPL (v2/3)]  A      \
mercurial/hgplugin.cpp   mercurial/gitplugin.cpp#830214 [License: GPL (v2/3)]  A      \
mercurial/hgplugin.h   mercurial/gitplugin.h#830214 [License: GPL (v2/3)]  A          \
mercurial/hgproxy.cpp   mercurial/gitproxy.cpp#830214 [License: GPL (v2/3)]  A        \
mercurial/hgproxy.h   mercurial/gitproxy.h#830214 [License: GPL (v2/3)]  M  +10 -7    \
mercurial/importdialog.cpp    M  +8 -4      mercurial/importdialog.h  
 D             mercurial/kdevgit.desktop  
 D             mercurial/kdevgit.rc  
 A             mercurial/kdevhg.desktop   mercurial/kdevgit.desktop#830214
 A             mercurial/kdevhg.rc   mercurial/kdevgit.rc#830214
 M  +9 -9      mercurial/tests/CMakeLists.txt  
 M  +48 -45    mercurial/tests/initTest.cpp   [POSSIBLY UNSAFE: system]
 M  +8 -5      mercurial/tests/initTest.h  


--- trunk/KDE/kdevplatform/plugins/CMakeLists.txt #830262:830263
@@ -52,6 +52,8 @@
 
 macro_optional_add_subdirectory(git)
 
+macro_optional_add_subdirectory(mercurial)
+
 macro_display_feature_log()
 
 
--- trunk/KDE/kdevplatform/plugins/mercurial/CMakeLists.txt #830262:830263
@@ -12,29 +12,29 @@
 
 ########### next target ###############
 
-set(kdevgit_PART_SRCS
-    gitplugin.cpp
-    gitjob.cpp
-    gitproxy.cpp
+set(kdevhg_PART_SRCS
+    hgplugin.cpp
+    hgjob.cpp
+    hgproxy.cpp
     commitdialog.cpp
-    gitmainview.cpp
-    gitgenericoutputview.cpp
+    hgmainview.cpp
+    hggenericoutputview.cpp
     importdialog.cpp
     importmetadatawidget.cpp
 )
 
-set(kdevgit_PART_UI
+set(kdevhg_PART_UI
     commitdialog.ui
     cvsgenericoutputview.ui
     cvsmainview.ui
     importmetadatawidget.ui
 )
 
-kde4_add_ui_files(kdevgit_PART_SRCS ${kdevgit_PART_UI})
-kde4_add_plugin(kdevgit ${kdevgit_PART_SRCS})
+kde4_add_ui_files(kdevhg_PART_SRCS ${kdevhg_PART_UI})
+kde4_add_plugin(kdevhg ${kdevhg_PART_SRCS})
 
 
-target_link_libraries(kdevgit
+target_link_libraries(kdevhg
     ${KDE4_KDECORE_LIBS}
     kdevplatformutil
     kdevplatforminterfaces
@@ -42,10 +42,10 @@
     kdevplatformproject
 )
 
-install(TARGETS kdevgit DESTINATION ${PLUGIN_INSTALL_DIR} )
+install(TARGETS kdevhg DESTINATION ${PLUGIN_INSTALL_DIR} )
 
 
 ########### install files ###############
-install( FILES kdevgit.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
-install( FILES kdevgit.rc DESTINATION ${DATA_INSTALL_DIR}/kdevgit )
+install( FILES kdevhg.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
+install( FILES kdevhg.rc DESTINATION ${DATA_INSTALL_DIR}/kdevhg )
 
--- trunk/KDE/kdevplatform/plugins/mercurial/importdialog.cpp #830262:830263
@@ -5,6 +5,9 @@
  *   Adapted for Git                                                       *
  *   Copyright 2008 Evgeniy Ivanov <powerfox@kde.ru>                       *
  *                                                                         *
+ *   Adapted for Hg                                                        *
+ *   Copyright 2008 Tom Burdick <thomas.burdick@gmail.com>                 *
+ *                                                                         *
  *   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        *
@@ -27,16 +30,16 @@
 #include <KMessageBox>
 #include <KDebug>
 
-#include "gitplugin.h"
-#include "gitproxy.h"
-#include "gitjob.h"
+#include "hgplugin.h"
+#include "hgproxy.h"
+#include "hgjob.h"
 
 #include <vcs/vcsmapping.h>
 #include <vcs/vcslocation.h>
 
 #include "importmetadatawidget.h"
 
-ImportDialog::ImportDialog(GitPlugin* plugin, const KUrl& url, QWidget *parent)
+ImportDialog::ImportDialog(HgPlugin* plugin, const KUrl& url, QWidget *parent)
     : KDialog(parent), m_url(url), m_plugin(plugin)
 {
     m_widget = new ImportMetadataWidget(this);
@@ -51,7 +54,7 @@
 
 void ImportDialog::accept()
 {
-    GitJob *job = dynamic_cast<GitJob*>( \
m_plugin->init(m_widget->getRepositoryLocation()) ); +    HgJob *job = \
dynamic_cast<HgJob*>( m_plugin->init(m_widget->getRepositoryLocation()) );  if (job) \
{  connect(job, SIGNAL( result(KJob*) ),
                 this, SLOT( jobFinished(KJob*) ));
@@ -67,11 +70,11 @@
     }
 
     // The job finished, now let's check the output is everything was OK
-    GitJob* gitjob = dynamic_cast<GitJob*>(job);
+    HgJob* hgjob = dynamic_cast<HgJob*>(job);
 
     static QRegExp re_file("^[IN]\\s(.*)");
     bool error = false;
-    QStringList lines = gitjob->output().split("\n");
+    QStringList lines = hgjob->output().split("\n");
     foreach(QString line, lines) {
         if (line.isEmpty()) {
             // ignore empty lines
--- trunk/KDE/kdevplatform/plugins/mercurial/importdialog.h #830262:830263
@@ -5,6 +5,9 @@
  *   Adapted for Git                                                       *
  *   Copyright 2008 Evgeniy Ivanov <powerfox@kde.ru>                       *
  *                                                                         *
+ *   Adapted for Hg                                                        *
+ *   Copyright 2008 Tom Burdick <thomas.burdick@gmail.com>                 *
+ *                                                                         *
  *   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        *
@@ -31,20 +34,21 @@
 
 class ImportMetadataWidget;
 
-class GitPlugin;
+class HgPlugin;
 
 /**
  * Asks the user for all options needed to init an existing directory into
- * a Git repository. In IBasicVersionControl "import" term is used, that is why 
+ * a Hg repository. In IBasicVersionControl "import" term is used, that is why 
  * it is called import, but not init.
  * @author Robert Gruber <rgruber@users.sourceforge.net>
  * @author Evgeniy Ivanov <powerfox@kde.ru>
+ * @author Tom Burdick <thomas.burdick@gmail.com>
  */
 class ImportDialog : public KDialog
 {
     Q_OBJECT
 public:
-    ImportDialog(GitPlugin *plugin, const KUrl& url, QWidget* parent=0);
+    ImportDialog(HgPlugin *plugin, const KUrl& url, QWidget* parent=0);
     virtual ~ImportDialog();
 
 public slots:
@@ -53,7 +57,7 @@
 
 private:
     KUrl m_url;
-    GitPlugin* m_plugin;
+    HgPlugin* m_plugin;
     ImportMetadataWidget* m_widget;
 };
 
--- trunk/KDE/kdevplatform/plugins/mercurial/tests/CMakeLists.txt #830262:830263
@@ -6,33 +6,33 @@
 
 if (UNIX)
 
-# Running the test only makes sense if the git command line client
+# Running the test only makes sense if the hg command line client
 # is present. So check for it before adding the test...
-FIND_PROGRAM(GIT NAMES git
+FIND_PROGRAM(HG NAMES hg
 	PATHS
 	/bin
 	/usr/bin
 	/usr/local/bin
 )
 
-if (GIT)
+if (HG)
 
 	include_directories( ${KDE4_INCLUDES}
 		${CMAKE_SOURCE_DIR}
         ${CMAKE_SOURCE_DIR}/util
         ${CMAKE_SOURCE_DIR}/interfaces
 		${CMAKE_SOURCE_DIR}/vcs
-		${CMAKE_SOURCE_DIR}/plugins/git
+		${CMAKE_SOURCE_DIR}/plugins/mercurial
 	)
     set( EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR} )
-	set(gitInitTest_SRCS initTest.cpp ../gitjob.cpp ../gitproxy.cpp)
-    kde4_add_unit_test(kdevgit-test ${gitInitTest_SRCS})
-	target_link_libraries(kdevgit-test
+	set(hgInitTest_SRCS initTest.cpp ../hgjob.cpp ../hgproxy.cpp)
+    kde4_add_unit_test(kdevhg-test ${hgInitTest_SRCS})
+	target_link_libraries(kdevhg-test
 		${QT_QTTEST_LIBRARY}
 		${KDE4_KDECORE_LIBS}
         kdevplatformutil
         kdevplatformvcs
 	)
-endif (GIT)
+endif (HG)
 
-endif (UNIX)
\ No newline at end of file
+endif (UNIX)
--- trunk/KDE/kdevplatform/plugins/mercurial/tests/initTest.cpp #830262:830263
@@ -5,6 +5,9 @@
  *   Adapted for Git                                                       *
  *   Copyright 2008 Evgeniy Ivanov <powerfox@kde.ru>                       *
  *                                                                         *
+ *   Adapted for Hg                                                        *
+ *   Copyright 2008 Tom Burdick <thomas.burdick@gmail.com>                 *
+ *                                                                         *
  *   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        *
@@ -27,54 +30,54 @@
 #include <QtTest/QtTest>
 #include <KUrl>
 
-#include <gitjob.h>
-#include <gitproxy.h>
+#include <hgjob.h>
+#include <hgproxy.h>
 
-#define GITTEST_DIR1            "kdevGit_testdir"
-#define GITTEST_BASEDIR         "/tmp/kdevGit_testdir/"
-#define GIT_REPO                GITTEST_BASEDIR".git"
-#define GITTEST_BASEDIR2        "/tmp/kdevGit_testdir2/"
-#define GIT_TESTFILE_NAME       "testfile"
+#define HGTEST_DIR1            "kdevHg_testdir"
+#define HGTEST_BASEDIR         "/tmp/kdevHg_testdir/"
+#define HG_REPO                HGTEST_BASEDIR".hg"
+#define HGTEST_BASEDIR2        "/tmp/kdevHg_testdir2/"
+#define HG_TESTFILE_NAME       "testfile"
 
 //TODO: bugs, this test didn't notice:
-//* git commit home/... wasn't notice
+//* hg commit home/... wasn't notice
 // test for isValidDirectory is required!!!
 
-void GitInitTest::initTestCase()
+void HgInitTest::initTestCase()
 {
-    m_proxy = new GitProxy;
+    m_proxy = new HgProxy;
 
     // If the basedir for this cvs test exists from a 
     // previous run; remove it...
-    if ( QFileInfo(GITTEST_BASEDIR).exists() ) {
-        system("rm -rf "GITTEST_BASEDIR"/*");
+    if ( QFileInfo(HGTEST_BASEDIR).exists() ) {
+        system("rm -rf "HGTEST_BASEDIR"/*");
     }
-    if ( QFileInfo(GITTEST_BASEDIR2).exists() ) {
-        system("rm -rf "GITTEST_BASEDIR2"/*");
+    if ( QFileInfo(HGTEST_BASEDIR2).exists() ) {
+        system("rm -rf "HGTEST_BASEDIR2"/*");
     }
 
     // Now create the basic directory structure
     QDir tmpdir("/tmp");
-    tmpdir.mkdir(GITTEST_BASEDIR);
-    tmpdir.mkdir(GITTEST_BASEDIR2);
+    tmpdir.mkdir(HGTEST_BASEDIR);
+    tmpdir.mkdir(HGTEST_BASEDIR2);
 }
 
-void GitInitTest::cleanupTestCase()
+void HgInitTest::cleanupTestCase()
 {
     delete m_proxy;
 
-   if ( QFileInfo(GITTEST_BASEDIR).exists() ) {
-       system("rm -rf "GITTEST_BASEDIR);
+   if ( QFileInfo(HGTEST_BASEDIR).exists() ) {
+       system("rm -rf "HGTEST_BASEDIR);
    }
-   if ( QFileInfo(GITTEST_BASEDIR2).exists() ) {
-       system("rm -rf "GITTEST_BASEDIR2);
+   if ( QFileInfo(HGTEST_BASEDIR2).exists() ) {
+       system("rm -rf "HGTEST_BASEDIR2);
    }
 }
 
-void GitInitTest::repoInit()
+void HgInitTest::repoInit()
 {
     // make job that creates the local repository
-    GitJob* j = m_proxy->init(KUrl(GITTEST_BASEDIR));
+    HgJob* j = m_proxy->init(KUrl(HGTEST_BASEDIR));
     QVERIFY( j );
 
 
@@ -82,45 +85,45 @@
     QVERIFY( j->exec() );
 
     //check if the CVSROOT directory in the new local repository exists now
-    QVERIFY( QFileInfo(QString(GIT_REPO)).exists() );
+    QVERIFY( QFileInfo(QString(HG_REPO)).exists() );
 }
 
-void GitInitTest::addFiles()
+void HgInitTest::addFiles()
 {
-    //we start it after repoInit, so we still have empty git repo
+    //we start it after repoInit, so we still have empty hg repo
     //First let's create a file
-    QFile f(GITTEST_BASEDIR""GIT_TESTFILE_NAME);
+    QFile f(HGTEST_BASEDIR""HG_TESTFILE_NAME);
     if(f.open(QIODevice::WriteOnly)) {
         QTextStream input( &f );
         input << "HELLO WORLD";
     }
     f.flush();
 
-    GitJob* j = m_proxy->add(QString(GITTEST_BASEDIR), \
KUrl::List(QStringList(GIT_TESTFILE_NAME))); +    HgJob* j = \
m_proxy->add(QString(HGTEST_BASEDIR), KUrl::List(QStringList(HG_TESTFILE_NAME)));  \
QVERIFY( j );  
     // try to start the job
     QVERIFY( j->exec() );
 
-    //since we added the file to the empty repository, .git/index should exist
+    //since we added the file to the empty repository, .hg/index should exist
     //TODO: maybe other method should be used
-    QString testfile(GIT_REPO"/index");
+    QString testfile(HG_REPO"/index");
     QVERIFY( QFileInfo(testfile).exists() );
 }
 
-void GitInitTest::commitFiles()
+void HgInitTest::commitFiles()
 {
     //we start it after addFiles, so we just have to commit
-    GitJob* j = m_proxy->commit(QString(GITTEST_BASEDIR), QString("KDevelop's Test \
                commit"),
-                                KUrl::List(QStringList(GIT_TESTFILE_NAME)));
+    HgJob* j = m_proxy->commit(QString(HGTEST_BASEDIR), QString("KDevelop's Test \
commit"), +                                \
KUrl::List(QStringList(HG_TESTFILE_NAME)));  QVERIFY( j );
 
     // try to start the job
     QVERIFY( j->exec() );
 
-    //since we commited the file to the "pure" repository, .git/refs/heads/master \
should exist +    //since we commited the file to the "pure" repository, \
.hg/refs/heads/master should exist  //TODO: maybe other method should be used
-    QString headRefName(GIT_REPO"/refs/heads/master");
+    QString headRefName(HG_REPO"/refs/heads/master");
     QVERIFY( QFileInfo(headRefName).exists() );
 
     QString firstCommit;
@@ -134,8 +137,8 @@
 
     QVERIFY(firstCommit!="");
 
-    //let's try to change the file and test "git commit -a"
-    QFile f(GITTEST_BASEDIR""GIT_TESTFILE_NAME);
+    //let's try to change the file and test "hg commit -a"
+    QFile f(HGTEST_BASEDIR""HG_TESTFILE_NAME);
     if(f.open(QIODevice::WriteOnly)) {
         QTextStream input( &f );
         input << "Just another HELLO WORLD";
@@ -143,7 +146,7 @@
     f.flush();
 
     //Since KJob uses delete later we don't care about deleting pld *j
-    j = m_proxy->commit(QString(GITTEST_BASEDIR), QString("KDevelop's Test \
commit2")); +    j = m_proxy->commit(QString(HGTEST_BASEDIR), QString("KDevelop's \
Test commit2"));  QVERIFY( j );
 
     // try to start the job
@@ -161,20 +164,20 @@
     QVERIFY(firstCommit != secondCommit);
 }
 
-void GitInitTest::cloneRepository()
+void HgInitTest::cloneRepository()
 {
     // make job that clones the local repository, created in the previous test
-    GitJob* j = m_proxy->clone(KUrl(GITTEST_BASEDIR), KUrl(GITTEST_BASEDIR2));
+    HgJob* j = m_proxy->clone(KUrl(HGTEST_BASEDIR), KUrl(HGTEST_BASEDIR2));
     QVERIFY( j );
 
     // try to start the job
     QVERIFY( j->exec() );
 
-    //check if the .git directory in the new local repository exists now
-    QVERIFY( QFileInfo(QString(GITTEST_BASEDIR2"kdevGit_testdir/.git/")).exists() );
+    //check if the .hg directory in the new local repository exists now
+    QVERIFY( QFileInfo(QString(HGTEST_BASEDIR2"kdevHg_testdir/.hg/")).exists() );
 }
 
-void GitInitTest::testInitAndCommit()
+void HgInitTest::testInitAndCommit()
 {
     repoInit();
     addFiles();
@@ -183,7 +186,7 @@
 }
 
 
-QTEST_MAIN(GitInitTest)
+QTEST_MAIN(HgInitTest)
 
 
-// #include "gittest.moc"
+// #include "hgtest.moc"
--- trunk/KDE/kdevplatform/plugins/mercurial/tests/initTest.h #830262:830263
@@ -5,6 +5,9 @@
  *   Adapted for Git                                                       *
  *   Copyright 2008 Evgeniy Ivanov <powerfox@kde.ru>                       *
  *                                                                         *
+ *   Adapted for Hg                                                        *
+ *   Copyright 2008 Tom Burdick <thomas.burdick@gmail.com>                 *
+ *                                                                         *
  *   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        *
@@ -22,14 +25,14 @@
  *   along with this program.  If not, see <http://www.gnu.org/licenses/>. *
  ***************************************************************************/
 
-#ifndef GIT_INIT_H
-#define GIT_INIT_H
+#ifndef HG_INIT_H
+#define HG_INIT_H
 
 #include <QtCore/QObject>
 
-class GitProxy;
+class HgProxy;
 
-class GitInitTest: public QObject
+class HgInitTest: public QObject
 {
     Q_OBJECT
 
@@ -47,7 +50,7 @@
         void cleanupTestCase();
 
     private:
-        GitProxy* m_proxy;
+        HgProxy* m_proxy;
 };
 
 #endif


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

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