/[gentoo-x86]/dev-vcs/svn2git/files/svn2git-1.0.8-utf8-author-names.patch
Gentoo

Contents of /dev-vcs/svn2git/files/svn2git-1.0.8-utf8-author-names.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Wed May 8 23:59:50 2013 UTC (16 months, 1 week ago) by sping
Branch: MAIN
CVS Tags: HEAD
dev-vcs/svn2git-1.0.8-r1: Fix for UTF-8 author names

(Portage version: 2.1.11.62/cvs/Linux x86_64, signed Manifest commit with key 0x401A1600)

1 From 6f931cd4535ba3e0d4dda31a0a5ab4a7f33b3221 Mon Sep 17 00:00:00 2001
2 From: Sebastian Pipping <sebastian@pipping.org>
3 Date: Thu, 9 May 2013 00:45:27 +0200
4 Subject: [PATCH] Stop unintended re-encoding of author names from UTF-8 to
5 ASCII
6 MIME-Version: 1.0
7 Content-Type: text/plain; charset=UTF-8
8 Content-Transfer-Encoding: 8bit
9
10 To see the bug in action, use an author map with umlauts, e.g.
11
12 nickname = Hällo Wörld from UTF-8 <mail@example.org>
13
14 and check "git log" after the conversion.
15
16 What is happening?
17 QByteArray "author" is first decoded as UTF-8 into a QString.
18 That QString is passed to QByteArray::append(const QString &)
19 which internally encodes the QString to ASCII byte data using
20 QString::toAscii(). "git fast-import" expects UTF-8 input
21 from us, so the original QByteArray with UTF-8 content is just
22 what we need.
23 ---
24 src/repository.cpp | 4 ++--
25 1 file changed, 2 insertions(+), 2 deletions(-)
26
27 diff --git a/src/repository.cpp b/src/repository.cpp
28 index 779dd28..f3b06e8 100644
29 --- a/src/repository.cpp
30 +++ b/src/repository.cpp
31 @@ -685,7 +685,7 @@ void Repository::Transaction::commitNote(const QByteArray &noteText, bool append
32 QByteArray s("");
33 s.append("commit refs/notes/commits\n");
34 s.append("mark :" + QByteArray::number(maxMark + 1) + "\n");
35 - s.append("committer " + QString::fromUtf8(author) + " " + QString::number(datetime) + " +0000" + "\n");
36 + s.append("committer " + author + " " + QString::number(datetime).toUtf8() + " +0000" + "\n");
37 s.append("data " + QString::number(message.length()) + "\n");
38 s.append(message + "\n");
39 s.append("N inline " + commitRef + "\n");
40 @@ -736,7 +736,7 @@ void Repository::Transaction::commit()
41 QByteArray s("");
42 s.append("commit " + branchRef + "\n");
43 s.append("mark :" + QByteArray::number(mark) + "\n");
44 - s.append("committer " + QString::fromUtf8(author) + " " + QString::number(datetime) + " +0000" + "\n");
45 + s.append("committer " + author + " " + QString::number(datetime).toUtf8() + " +0000" + "\n");
46 s.append("data " + QString::number(message.length()) + "\n");
47 s.append(message + "\n");
48 repository->fastImport.write(s);
49 --
50 1.8.2.1

  ViewVC Help
Powered by ViewVC 1.1.20