| 107 | } |
| 108 | |
| 109 | void TestSvnRecursiveAdd::test() |
| 110 | { |
| 111 | QTemporaryDir reposDir; |
| 112 | KProcess cmd; |
| 113 | cmd.setWorkingDirectory(reposDir.path()); |
| 114 | cmd << QStringLiteral("svnadmin") << QStringLiteral("create") << reposDir.path(); |
| 115 | QCOMPARE(cmd.execute(10000), 0); |
| 116 | const QList<IPlugin*> plugins = Core::self()->pluginController()->allPluginsForExtension(QStringLiteral("org.kdevelop.IBasicVersionControl")); |
| 117 | IBasicVersionControl* vcs = nullptr; |
| 118 | for (IPlugin* p : plugins) { |
| 119 | qDebug() << "checking plugin" << p; |
| 120 | auto* icentr = p->extension<ICentralizedVersionControl>(); |
| 121 | if (!icentr) |
| 122 | continue; |
| 123 | if (icentr->name() == QLatin1String("Subversion")) { |
| 124 | vcs = icentr; |
| 125 | break; |
| 126 | } |
| 127 | } |
| 128 | qDebug() << "ok, got vcs" << vcs; |
| 129 | QVERIFY(vcs); |
| 130 | VcsLocation reposLoc; |
| 131 | reposLoc.setRepositoryServer("file://" + reposDir.path()); |
| 132 | QTemporaryDir checkoutDir; |
| 133 | QUrl checkoutLoc = QUrl::fromLocalFile(checkoutDir.path()); |
| 134 | qDebug() << "Checking out from " << reposLoc.repositoryServer() << " to " << checkoutLoc; |
| 135 | qDebug() << "creating job"; |
| 136 | VcsJob* job = vcs->createWorkingCopy( reposLoc, checkoutLoc ); |
| 137 | validatingExecJob(job); |
| 138 | qDebug() << "filling wc"; |
| 139 | fillWorkingDirectory(checkoutDir.path()); |
| 140 | QUrl addUrl = QUrl::fromLocalFile( checkoutDir.path() + '/' + vcsTestDir0() ); |
| 141 | qDebug() << "Recursively adding files at " << addUrl; |
| 142 | validatingExecJob(vcs->add({addUrl}, IBasicVersionControl::Recursive)); |
| 143 | qDebug() << "Recursively reverting changes at " << addUrl; |
| 144 | validatingExecJob(vcs->revert({addUrl}, IBasicVersionControl::Recursive)); |
| 145 | } |
| 146 | |
| 147 | QTEST_MAIN(TestSvnRecursiveAdd) |
| 148 |
no test coverage detected