aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThiago Macieira <thiago@cassini.local.lan>2007-12-23 14:50:27 -0200
committerThiago Macieira <thiago@cassini.local.lan>2007-12-23 14:50:27 -0200
commit5a7327f691416d3b061318da00fbd85a341f710a (patch)
treee8390acfcf4df4d2866960ba216a11ab295024ac /src
parentc25fce2e70dab730cc8e117f2ceb6c0954bd3d48 (diff)
downloadsvn2git-5a7327f691416d3b061318da00fbd85a341f710a.tar
svn2git-5a7327f691416d3b061318da00fbd85a341f710a.tar.gz
svn2git-5a7327f691416d3b061318da00fbd85a341f710a.tar.bz2
svn2git-5a7327f691416d3b061318da00fbd85a341f710a.tar.xz
svn2git-5a7327f691416d3b061318da00fbd85a341f710a.zip
Add the Repository class
Diffstat (limited to 'src')
-rw-r--r--src/repository.cpp32
-rw-r--r--src/repository.h43
-rw-r--r--src/src.pro3
3 files changed, 77 insertions, 1 deletions
diff --git a/src/repository.cpp b/src/repository.cpp
new file mode 100644
index 0000000..c3174b8
--- /dev/null
+++ b/src/repository.cpp
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2007 Thiago Macieira <thiago@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, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "repository.h"
+
+Repository::Repository(const Rules::Repository &rule)
+{
+ foreach (Rules::Repository::Branch branchRule, rule.branches) {
+ Branch branch;
+ branch.branchFrom = branchRule.branchFrom;
+ branch.isCreated = false;
+
+ branches.insert(branchRule.name, branch);
+ }
+
+ fastImport.setWorkingDirectory(rule.name);
+ fastImport.setProcessChannelMode(QProcess::ForwardedChannels);
+}
diff --git a/src/repository.h b/src/repository.h
new file mode 100644
index 0000000..7779bdf
--- /dev/null
+++ b/src/repository.h
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2007 Thiago Macieira <thiago@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, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef REPOSITORY_H
+#define REPOSITORY_H
+
+#include <QHash>
+#include <QProcess>
+
+#include "ruleparser.h"
+
+class Repository
+{
+public:
+ struct Branch
+ {
+ QString branchFrom;
+ bool isCreated;
+ };
+
+ Repository(const Rules::Repository &rule);
+ ~Repository();
+
+private:
+ QHash<QString, Branch> branches;
+ QProcess fastImport;
+};
+
+#endif
diff --git a/src/src.pro b/src/src.pro
index f8e76f6..e6cff4f 100644
--- a/src/src.pro
+++ b/src/src.pro
@@ -9,4 +9,5 @@ INCLUDEPATH += .
QT = core
# Input
-SOURCES += ruleparser.cpp
+SOURCES += ruleparser.cpp repository.cpp
+HEADERS += ruleparser.h repository.h