From f9959041d22deb2f69f610d4eadc9a48d8642fcc Mon Sep 17 00:00:00 2001
From: Roman Kovalev <rnax@mail.ru>
Date: Wed, 17 Nov 2010 17:20:22 +0100
Subject: [PATCH] svn: annotate codec - bugfix

getCodec() needs to be called with an absolute file name.

As the changed decoding of the file contents will break the decoding of
svn's annotation prefixes (which are in system locale), force LC_ALL=C
to prevent an encoding mix in the first place.

Merge-request: 214
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
---
 src/plugins/subversion/subversionplugin.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/plugins/subversion/subversionplugin.cpp b/src/plugins/subversion/subversionplugin.cpp
index 9ecafbfe748..c3a1f9f5bc9 100644
--- a/src/plugins/subversion/subversionplugin.cpp
+++ b/src/plugins/subversion/subversionplugin.cpp
@@ -913,7 +913,8 @@ void SubversionPlugin::vcsAnnotate(const QString &workingDir, const QString &fil
                                 const QString &revision /* = QString() */,
                                 int lineNumber /* = -1 */)
 {
-    QTextCodec *codec = VCSBase::VCSBaseEditor::getCodec(file);
+    const QString source = VCSBase::VCSBaseEditor::getSource(workingDir, file);
+    QTextCodec *codec = VCSBase::VCSBaseEditor::getCodec(source);
 
     QStringList args(QLatin1String("annotate"));
     if (m_settings.spaceIgnorantAnnotation)
@@ -925,13 +926,12 @@ void SubversionPlugin::vcsAnnotate(const QString &workingDir, const QString &fil
 
     const SubversionResponse response =
             runSvn(workingDir, args, m_settings.timeOutMS(),
-                   SshPasswordPrompt, codec);
+                   SshPasswordPrompt|ForceCLocale, codec);
     if (response.error)
         return;
 
     // Re-use an existing view if possible to support
     // the common usage pattern of continuously changing and diffing a file
-    const QString source = workingDir + QLatin1Char('/') + file;
     if (lineNumber <= 0)
         lineNumber = VCSBase::VCSBaseEditor::lineNumberOfCurrentEditor(source);
     // Determine id
-- 
GitLab