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>
This commit is contained in:
Roman Kovalev
2010-11-17 17:20:22 +01:00
committed by Oswald Buddenhagen
parent 6e1c4c8e9c
commit f9959041d2

View File

@@ -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