From b6ba9639a3c908aedb76954a575641c56a76714c Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 24 Dec 2007 00:44:01 -0200 Subject: Fix crashes and improve behaviour --- src/repository.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to '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) { -- cgit v1.2.1