diff options
Diffstat (limited to 'dev-vcs/svn2git/files/svn2git-1.0.3-backup-refs.patch')
-rw-r--r-- | dev-vcs/svn2git/files/svn2git-1.0.3-backup-refs.patch | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/dev-vcs/svn2git/files/svn2git-1.0.3-backup-refs.patch b/dev-vcs/svn2git/files/svn2git-1.0.3-backup-refs.patch new file mode 100644 index 000000000000..6241bb765331 --- /dev/null +++ b/dev-vcs/svn2git/files/svn2git-1.0.3-backup-refs.patch @@ -0,0 +1,45 @@ +From 584005f2e26149282aa12c4a0367d250caaf3918 Mon Sep 17 00:00:00 2001 +From: Jehan Bing <nahor.j@gmail.com> +Date: Thu, 10 Mar 2011 10:54:52 -0800 +Subject: [PATCH] Create backup reference before deletion of the original branch + +Ensure that the backup reference is created before deleting the original +branch. As it was, the deletion was executed earlier causing the backup +reference to point to a non-existing branch so was not created. +--- + src/repository.cpp | 7 ++++--- + 1 files changed, 4 insertions(+), 3 deletions(-) + +diff --git a/src/repository.cpp b/src/repository.cpp +index 7de840f..2c70bf3 100644 +--- a/src/repository.cpp ++++ b/src/repository.cpp +@@ -349,11 +349,12 @@ int Repository::resetBranch(const QString &branch, int revnum, int mark, const Q + branchRef.prepend("refs/heads/"); + + Branch &br = branches[branch]; ++ QByteArray backupCmd; + if (br.created && br.created != revnum && !br.marks.isEmpty() && br.marks.last()) { + QByteArray backupBranch = "refs/backups/r" + QByteArray::number(revnum) + branchRef.mid(4); + qWarning() << "WARN: backing up branch" << branch << "to" << backupBranch; + +- resetBranches.append("reset " + backupBranch + "\nfrom " + branchRef + "\n\n"); ++ backupCmd = "reset " + backupBranch + "\nfrom " + branchRef + "\n\n"; + } + + br.created = revnum; +@@ -365,9 +366,9 @@ int Repository::resetBranch(const QString &branch, int revnum, int mark, const Q + + " branch " + branch.toUtf8() + " = :" + QByteArray::number(mark) + + " # " + comment + "\n\n"; + if(comment == "delete") +- deletedBranches.append(cmd); ++ deletedBranches.append(backupCmd).append(cmd); + else +- resetBranches.append(cmd); ++ resetBranches.append(backupCmd).append(cmd); + + return EXIT_SUCCESS; + } +-- +1.7.4.1 + |