mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
WI-11384 SVN: can't commit file (correct encoding for input stream passed into SAX parser of command-line svn output)
This commit is contained in:
+3
-2
@@ -18,6 +18,7 @@ package org.jetbrains.idea.svn.commandLine;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vcs.VcsException;
|
||||
import com.intellij.openapi.vfs.CharsetToolkit;
|
||||
import com.intellij.util.Consumer;
|
||||
import org.jetbrains.idea.svn.SvnVcs;
|
||||
import org.jetbrains.idea.svn.portable.SvnExceptionWrapper;
|
||||
@@ -32,6 +33,7 @@ import sun.reflect.generics.reflectiveObjects.NotImplementedException;
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
import javax.xml.parsers.SAXParser;
|
||||
import javax.xml.parsers.SAXParserFactory;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.StringBufferInputStream;
|
||||
@@ -106,9 +108,8 @@ public class SvnCommandLineInfoClient extends SvnkitSvnWcClient {
|
||||
|
||||
try {
|
||||
final String result = command.run();
|
||||
// todo not synchronized wrapper stream!
|
||||
SAXParser parser = SAXParserFactory.newInstance().newSAXParser();
|
||||
parser.parse(new StringBufferInputStream(result), infoHandler[0]);
|
||||
parser.parse(new ByteArrayInputStream(result.getBytes(CharsetToolkit.UTF8_CHARSET)), infoHandler[0]);
|
||||
|
||||
}
|
||||
catch (SvnExceptionWrapper e) {
|
||||
|
||||
+2
-2
@@ -18,6 +18,7 @@ package org.jetbrains.idea.svn.commandLine;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.vcs.VcsException;
|
||||
import com.intellij.openapi.vfs.CharsetToolkit;
|
||||
import com.intellij.util.containers.Convertor;
|
||||
import org.jetbrains.idea.svn.SvnUtil;
|
||||
import org.jetbrains.idea.svn.portable.PortableStatus;
|
||||
@@ -156,9 +157,8 @@ public class SvnCommandLineStatusClient implements SvnStatusClientI {
|
||||
|
||||
try {
|
||||
final String result = command.run();
|
||||
// todo not synchronized wrapper stream!
|
||||
SAXParser parser = SAXParserFactory.newInstance().newSAXParser();
|
||||
parser.parse(new StringBufferInputStream(result), svnHandl[0]);
|
||||
parser.parse(new ByteArrayInputStream(result.getBytes(CharsetToolkit.UTF8_CHARSET)), svnHandl[0]);
|
||||
if (! svnHandl[0].isAnythingReported()) {
|
||||
if (! SvnUtil.isSvnVersioned(myProject, path)) {
|
||||
throw new SVNException(SVNErrorMessage.create(SVNErrorCode.WC_NOT_DIRECTORY));
|
||||
|
||||
Reference in New Issue
Block a user