aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThiago Macieira <thiago@doriath.(none)>2008-08-13 12:28:45 +0200
committerThiago Macieira <thiago.macieira@trolltech.com>2008-08-13 12:28:59 +0200
commit7dd430d8609e657709ae794762c6eebb0000b249 (patch)
tree7903542d20f28f3977f5d69143013bd1a779b764
parentf34275cff05668492a134a69cacac16f799c2493 (diff)
downloadsvn2git-7dd430d8609e657709ae794762c6eebb0000b249.tar
svn2git-7dd430d8609e657709ae794762c6eebb0000b249.tar.gz
svn2git-7dd430d8609e657709ae794762c6eebb0000b249.tar.bz2
svn2git-7dd430d8609e657709ae794762c6eebb0000b249.tar.xz
svn2git-7dd430d8609e657709ae794762c6eebb0000b249.zip
Try auto-creation of branches
-rw-r--r--src/repository.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/repository.cpp b/src/repository.cpp
index ab4c1bf..538b6f0 100644
--- a/src/repository.cpp
+++ b/src/repository.cpp
@@ -77,8 +77,8 @@ void Repository::createBranch(const QString &branch, int revnum,
const QString &branchFrom, int)
{
if (!branches.contains(branch)) {
- qCritical() << branch << "is not a known branch in repository" << name;
- exit(1);
+ qWarning() << branch << "is not a known branch in repository" << name << endl
+ << "Going to create it automatically";
}
startFastImport();
@@ -100,6 +100,13 @@ void Repository::createBranch(const QString &branch, int revnum,
if (!branchFromRef.startsWith("refs/"))
branchFromRef.prepend("refs/heads/");
+ if (!branches.contains(branchFrom) || !branches.value(branchFrom).created) {
+ qCritical() << branch << "in repository" << name
+ << "is branching from branch" << branchFrom
+ << "but the latter doesn't exist. Can't continue.";
+ exit(1);
+ }
+
fastImport.write("reset " + branchRef + "\nfrom " + branchFromRef + "\n\n");
}