diff options
author | Raja R Harinath <harinath@hurrynot.org> | 2010-07-20 23:13:16 +0530 |
---|---|---|
committer | Raja R Harinath <harinath@hurrynot.org> | 2010-07-21 00:47:38 +0530 |
commit | 851fc6e50d0f30f9f42dcd2f9e3de8b23357b560 (patch) | |
tree | 23216a56fbfd8c2a903cb4fd134010796c11fc28 | |
parent | 0e512033f95a4b2153aecf7c6bd677f626eb7138 (diff) | |
download | svn2git-851fc6e50d0f30f9f42dcd2f9e3de8b23357b560.tar svn2git-851fc6e50d0f30f9f42dcd2f9e3de8b23357b560.tar.gz svn2git-851fc6e50d0f30f9f42dcd2f9e3de8b23357b560.tar.bz2 svn2git-851fc6e50d0f30f9f42dcd2f9e3de8b23357b560.tar.xz svn2git-851fc6e50d0f30f9f42dcd2f9e3de8b23357b560.zip |
Make Repository::createBranch use resetBranch now that they're similar
-rw-r--r-- | src/repository.cpp | 25 |
1 files changed, 1 insertions, 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) |