aboutsummaryrefslogtreecommitdiffstats
path: root/src/repository.cpp
diff options
context:
space:
mode:
authorThiago Macieira <thiago@cassini.local.lan>2007-12-24 00:44:01 -0200
committerThiago Macieira <thiago@cassini.local.lan>2007-12-24 00:45:23 -0200
commitb6ba9639a3c908aedb76954a575641c56a76714c (patch)
treeb4f39c68a43a314c817b911025beb04e51391cbf /src/repository.cpp
parentc7d45e66be31b72663e3a5a13a60eef31d458e0a (diff)
downloadsvn2git-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.cpp11
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) {