diff options
author | Thiago Macieira <thiago@cassini.local.lan> | 2007-12-24 00:44:01 -0200 |
---|---|---|
committer | Thiago Macieira <thiago@cassini.local.lan> | 2007-12-24 00:45:23 -0200 |
commit | b6ba9639a3c908aedb76954a575641c56a76714c (patch) | |
tree | b4f39c68a43a314c817b911025beb04e51391cbf /src/repository.cpp | |
parent | c7d45e66be31b72663e3a5a13a60eef31d458e0a (diff) | |
download | svn2git-b6ba9639a3c908aedb76954a575641c56a76714c.tar svn2git-b6ba9639a3c908aedb76954a575641c56a76714c.tar.gz svn2git-b6ba9639a3c908aedb76954a575641c56a76714c.tar.bz2 svn2git-b6ba9639a3c908aedb76954a575641c56a76714c.tar.xz svn2git-b6ba9639a3c908aedb76954a575641c56a76714c.zip |
Fix crashes and improve behaviour
Diffstat (limited to 'src/repository.cpp')
-rw-r--r-- | src/repository.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
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 <QTextStream> +#include <QDebug> 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) { |