X-Git-Url: http://andersk.mit.edu/gitweb/svn-all-fast-export.git/blobdiff_plain/688d69ec473b06fb767cf29b62d66e9642c19a91..1228bd7c87f4e203883086d6884280653a8d1777:/src/repository.cpp diff --git a/src/repository.cpp b/src/repository.cpp index bd229f0..8a5f4f0 100644 --- a/src/repository.cpp +++ b/src/repository.cpp @@ -17,8 +17,10 @@ #include "repository.h" #include +#include Repository::Repository(const Rules::Repository &rule) + : name(rule.name) { foreach (Rules::Repository::Branch branchRule, rule.branches) { Branch branch; @@ -28,6 +30,9 @@ Repository::Repository(const Rules::Repository &rule) branches.insert(branchRule.name, branch); } + // create the default branch + branches["master"].isCreated = true; + fastImport.setWorkingDirectory(rule.name); fastImport.setProcessChannelMode(QProcess::ForwardedChannels); } @@ -43,8 +48,10 @@ Repository::~Repository() Repository::Transaction *Repository::newTransaction(const QString &branch, const QString &svnprefix, int revnum) { - if (!branches.contains(branch)) + if (!branches.contains(branch)) { + qCritical() << branch << "is not known in repository" << name; return 0; + } Transaction *txn = new Transaction; txn->repository = this; @@ -125,7 +132,7 @@ void Repository::Transaction::commit() QTextStream s(&repository->fastImport); s << "commit " << branchRef << endl; s << "mark :" << revnum << endl; - s << "committer " << author << ' ' << datetime << "-0000" << endl; + s << "committer " << author << ' ' << datetime << " -0000" << endl; Branch &br = repository->branches[branch]; if (!br.isCreated) {