From 851fc6e50d0f30f9f42dcd2f9e3de8b23357b560 Mon Sep 17 00:00:00 2001 From: Raja R Harinath Date: Tue, 20 Jul 2010 23:13:16 +0530 Subject: Make Repository::createBranch use resetBranch now that they're similar --- src/repository.cpp | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/src/repository.cpp b/src/repository.cpp index d0826e5..d70119b 100644 --- a/src/repository.cpp +++ b/src/repository.cpp @@ -312,30 +312,7 @@ int Repository::createBranch(const QString &branch, int revnum, branchFromDesc += ", deleted/unknown"; } - QByteArray branchRef = branch.toUtf8(); - if (!branchRef.startsWith("refs/")) - branchRef.prepend("refs/heads/"); - - Branch &br = branches[branch]; - if (br.created && br.created != revnum && br.marks.last()) { - QByteArray backupBranch = branchRef + '_' + QByteArray::number(revnum); - qWarning() << branch << "already exists; backing up to" << backupBranch; - - fastImport.write("reset " + backupBranch + "\nfrom " + branchRef + "\n\n"); - } - - // now create the branch - br.created = revnum; - br.commits.append(revnum); - br.marks.append(mark); - - fastImport.write("reset " + branchRef + "\nfrom " + branchFromRef + "\n\n" - "progress SVN r" + QByteArray::number(revnum) - + " branch " + branch.toUtf8() + " = :" + QByteArray::number(mark) - + " # " + branchFromDesc - + "\n\n"); - - return EXIT_SUCCESS; + return resetBranch(branch, revnum, mark, branchFromRef, branchFromDesc); } int Repository::deleteBranch(const QString &branch, int revnum) -- cgit v1.2.1