/[gentoo-x86]/dev-vcs/svn2git/files/svn2git-1.0.3-backup-refs.patch
Gentoo

Contents of /dev-vcs/svn2git/files/svn2git-1.0.3-backup-refs.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Wed Apr 6 17:07:14 2011 UTC (3 years, 6 months ago) by sping
Branch: MAIN
CVS Tags: HEAD
dev-vcs/svn2git: Bump to 1.0.3

(Portage version: 2.1.9.45/cvs/Linux x86_64)

1 From 584005f2e26149282aa12c4a0367d250caaf3918 Mon Sep 17 00:00:00 2001
2 From: Jehan Bing <nahor.j@gmail.com>
3 Date: Thu, 10 Mar 2011 10:54:52 -0800
4 Subject: [PATCH] Create backup reference before deletion of the original branch
5
6 Ensure that the backup reference is created before deleting the original
7 branch. As it was, the deletion was executed earlier causing the backup
8 reference to point to a non-existing branch so was not created.
9 ---
10 src/repository.cpp | 7 ++++---
11 1 files changed, 4 insertions(+), 3 deletions(-)
12
13 diff --git a/src/repository.cpp b/src/repository.cpp
14 index 7de840f..2c70bf3 100644
15 --- a/src/repository.cpp
16 +++ b/src/repository.cpp
17 @@ -349,11 +349,12 @@ int Repository::resetBranch(const QString &branch, int revnum, int mark, const Q
18 branchRef.prepend("refs/heads/");
19
20 Branch &br = branches[branch];
21 + QByteArray backupCmd;
22 if (br.created && br.created != revnum && !br.marks.isEmpty() && br.marks.last()) {
23 QByteArray backupBranch = "refs/backups/r" + QByteArray::number(revnum) + branchRef.mid(4);
24 qWarning() << "WARN: backing up branch" << branch << "to" << backupBranch;
25
26 - resetBranches.append("reset " + backupBranch + "\nfrom " + branchRef + "\n\n");
27 + backupCmd = "reset " + backupBranch + "\nfrom " + branchRef + "\n\n";
28 }
29
30 br.created = revnum;
31 @@ -365,9 +366,9 @@ int Repository::resetBranch(const QString &branch, int revnum, int mark, const Q
32 + " branch " + branch.toUtf8() + " = :" + QByteArray::number(mark)
33 + " # " + comment + "\n\n";
34 if(comment == "delete")
35 - deletedBranches.append(cmd);
36 + deletedBranches.append(backupCmd).append(cmd);
37 else
38 - resetBranches.append(cmd);
39 + resetBranches.append(backupCmd).append(cmd);
40
41 return EXIT_SUCCESS;
42 }
43 --
44 1.7.4.1

  ViewVC Help
Powered by ViewVC 1.1.20