]> andersk Git - svn-all-fast-export.git/blobdiff - src/repository.h
Fail if writing to the process fails
[svn-all-fast-export.git] / src / repository.h
index 7779bdf31ff6f0a918c133aaf54ae61667825b4e..4692080a2f5c077b6c823165e2f25d5d75c046b1 100644 (file)
 class Repository
 {
 public:
-    struct Branch
+    class Transaction
     {
-        QString branchFrom;
-        bool isCreated;
-    };
+        Q_DISABLE_COPY(Transaction)
+        friend class Repository;
+        struct FileProperties {
+            int mode;
+            int mark;
+        };
+
+        Repository *repository;
+        QByteArray branch;
+        QByteArray svnprefix;
+        QByteArray author;
+        QByteArray log;
+        uint datetime;
+        int revnum;
+        int lastmark;
+
+        QStringList deletedFiles;
+        QHash<QString, FileProperties> modifiedFiles;
 
+        inline Transaction() {}
+    public:
+        ~Transaction();
+        void commit();
+
+        void setAuthor(const QByteArray &author);
+        void setDateTime(uint dt);
+        void setLog(const QByteArray &log);
+
+        void deleteFile(const QString &path);
+        QIODevice *addFile(const QString &path, int mode, qint64 length);
+    };
     Repository(const Rules::Repository &rule);
     ~Repository();
 
+    void reloadBranches();
+    void createBranch(const QString &branch, int revnum,
+                      const QString &branchFrom, int revFrom);
+    Transaction *newTransaction(const QString &branch, const QString &svnprefix, int revnum);
+
 private:
+    struct Branch
+    {
+        int created;
+    };
+
     QHash<QString, Branch> branches;
+    QString name;
     QProcess fastImport;
+    int commitCount;
+    bool processHasStarted;
+
+    void startFastImport();
+
+    Q_DISABLE_COPY(Repository)
 };
 
 #endif
This page took 0.387836 seconds and 4 git commands to generate.