]> andersk Git - svn-all-fast-export.git/commitdiff
Add the Repository class
authorThiago Macieira <thiago@cassini.local.lan>
Sun, 23 Dec 2007 16:50:27 +0000 (14:50 -0200)
committerThiago Macieira <thiago@cassini.local.lan>
Sun, 23 Dec 2007 16:50:27 +0000 (14:50 -0200)
src/repository.cpp [new file with mode: 0644]
src/repository.h [new file with mode: 0644]
src/src.pro

diff --git a/src/repository.cpp b/src/repository.cpp
new file mode 100644 (file)
index 0000000..c3174b8
--- /dev/null
@@ -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 (file)
index 0000000..7779bdf
--- /dev/null
@@ -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
index f8e76f6e226cfb696e23a84ee7b2b7011d828747..e6cff4fe949cc2dc2aa65b7d81523ea00e4a8ab2 100644 (file)
@@ -9,4 +9,5 @@ INCLUDEPATH += .
 QT = core
 
 # Input
-SOURCES += ruleparser.cpp
+SOURCES += ruleparser.cpp repository.cpp
+HEADERS += ruleparser.h repository.h
This page took 0.05442 seconds and 5 git commands to generate.