diff options
author | Thomas Zander <zander@kde.org> | 2009-10-20 18:12:21 +0200 |
---|---|---|
committer | Thomas Zander <zander@kde.org> | 2009-10-20 18:12:21 +0200 |
commit | daded9dd3fe77b6e56e617fbbe612317c644dc7a (patch) | |
tree | 3ddbc185b3b2f33999ea01f3da82a08150ffc1aa /src | |
parent | e6174e93417489bb4921c0a4767ffd3e80a86871 (diff) | |
download | svn2git-daded9dd3fe77b6e56e617fbbe612317c644dc7a.tar svn2git-daded9dd3fe77b6e56e617fbbe612317c644dc7a.tar.gz svn2git-daded9dd3fe77b6e56e617fbbe612317c644dc7a.tar.bz2 svn2git-daded9dd3fe77b6e56e617fbbe612317c644dc7a.tar.xz svn2git-daded9dd3fe77b6e56e617fbbe612317c644dc7a.zip |
Create repos as we go.
Instead of failing with an unhelpful error in fast-import we create the
repositories we require to import into if they don't exist.
Diffstat (limited to 'src')
-rw-r--r-- | src/repository.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/repository.cpp b/src/repository.cpp index 182309c..72d681e 100644 --- a/src/repository.cpp +++ b/src/repository.cpp @@ -1,5 +1,6 @@ /* * Copyright (C) 2007 Thiago Macieira <thiago@kde.org> + * Copyright (C) 2009 Thomas Zander <zander@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 @@ -19,6 +20,7 @@ #include "options.h" #include <QTextStream> #include <QDebug> +#include <QDir> #include <QLinkedList> static const int maxSimultaneousProcesses = 100; @@ -63,6 +65,16 @@ Repository::Repository(const Rules::Repository &rule) branches["master"].created = 1; fastImport.setWorkingDirectory(name); +#ifndef DRY_RUN + if (!QDir(name).exists()) { // repo doesn't exist yet. + qDebug() << "Creating new repositoryn" << name; + QDir::current().mkpath(name); + QProcess init; + init.setWorkingDirectory(name); + init.start("git", QStringList() << "--bare" << "init"); + init.waitForFinished(-1); + } +#endif } Repository::~Repository() |