Search in sources :

Example 6 with SVNException

use of org.tmatesoft.svn.core.SVNException in project intellij-community by JetBrains.

the class DefaultBranchConfigInitializer method getDefaultConfiguration.

@Nullable
public SvnBranchConfigurationNew getDefaultConfiguration() {
    SvnBranchConfigurationNew result = null;
    SvnVcs vcs = SvnVcs.getInstance(myProject);
    SVNURL rootUrl = SvnUtil.getUrl(vcs, VfsUtilCore.virtualToIoFile(myRoot));
    if (rootUrl != null) {
        try {
            result = getDefaultConfiguration(vcs, rootUrl);
        } catch (SVNException | VcsException e) {
            LOG.info(e);
        }
    } else {
        LOG.info("Directory is not a working copy: " + myRoot.getPresentableUrl());
    }
    return result;
}
Also used : SVNURL(org.tmatesoft.svn.core.SVNURL) VcsException(com.intellij.openapi.vcs.VcsException) SVNException(org.tmatesoft.svn.core.SVNException) SvnVcs(org.jetbrains.idea.svn.SvnVcs) Nullable(org.jetbrains.annotations.Nullable)

Example 7 with SVNException

use of org.tmatesoft.svn.core.SVNException in project intellij-community by JetBrains.

the class SvnFileSystemListener method for16move.

private boolean for16move(SvnVcs vcs, final File src, final File dst, final boolean undo) throws VcsException {
    final SVNMoveClient mover = vcs.getSvnKitManager().createMoveClient();
    if (undo) {
        myUndoingMove = true;
        restoreFromUndoStorage(dst);
    } else if (doUsualMove(vcs, src))
        return true;
    new RepeatSvnActionThroughBusy() {

        @Override
        protected void executeImpl() throws VcsException {
            try {
                if (undo) {
                    mover.undoMove(src, dst);
                } else {
                    mover.doMove(src, dst);
                }
            } catch (SVNException e) {
                throw new SvnBindException(e);
            }
        }
    }.execute();
    return false;
}
Also used : SvnBindException(org.jetbrains.idea.svn.commandLine.SvnBindException) SVNMoveClient(org.tmatesoft.svn.core.wc.SVNMoveClient) SVNException(org.tmatesoft.svn.core.SVNException)

Example 8 with SVNException

use of org.tmatesoft.svn.core.SVNException in project intellij-community by JetBrains.

the class SvnUtil method getWorkingCopyRoot.

@Nullable
public static File getWorkingCopyRoot(final File inFile) {
    File file = inFile;
    while ((file != null) && (file.isFile() || (!file.exists()))) {
        file = file.getParentFile();
    }
    if (file == null) {
        return null;
    }
    File workingCopyRoot = null;
    try {
        workingCopyRoot = SVNWCUtil.getWorkingCopyRoot(file, true);
    } catch (SVNException e) {
    //
    }
    if (workingCopyRoot == null) {
        workingCopyRoot = getWcCopyRootIf17(file, null);
    }
    return workingCopyRoot;
}
Also used : SVNException(org.tmatesoft.svn.core.SVNException) VirtualFile(com.intellij.openapi.vfs.VirtualFile) VfsUtilCore.virtualToIoFile(com.intellij.openapi.vfs.VfsUtilCore.virtualToIoFile) File(java.io.File) Nullable(org.jetbrains.annotations.Nullable)

Example 9 with SVNException

use of org.tmatesoft.svn.core.SVNException in project intellij-community by JetBrains.

the class SvnParseCommandLineParseTest method testStatusWithSwitched.

public void testStatusWithSwitched() throws Exception {
    final String s = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<status>\n" + "<target\n" + "   path=\".\">\n" + "<entry\n" + "   path=\"root\\source\\s1.txt\">\n" + "<wc-status\n" + "   props=\"none\"\n" + "   switched=\"true\"\n" + "   item=\"normal\"\n" + "   revision=\"5\">\n" + "<commit\n" + "   revision=\"4\">\n" + "<author>Irina.Chernushina</author>\n" + "<date>2013-02-18T13:14:24.391537Z</date>\n" + "</commit>\n" + "</wc-status>\n" + "</entry>\n" + "<entry\n" + "   path=\"root\\target\">\n" + "<wc-status\n" + "   props=\"none\"\n" + "   switched=\"true\"\n" + "   item=\"normal\"\n" + "   revision=\"5\">\n" + "<commit\n" + "   revision=\"4\">\n" + "<author>Irina.Chernushina</author>\n" + "<date>2013-02-18T13:14:24.391537Z</date>\n" + "</commit>\n" + "</wc-status>\n" + "</entry>\n" + "</target>\n" + "</status>";
    final SvnStatusHandler[] handlerArr = new SvnStatusHandler[1];
    final boolean isWindows = SystemInfo.isWindows;
    final String basePath = isWindows ? "C:/base/" : "/base33729/";
    final Set<PortableStatus> statuses = new HashSet<>();
    final SvnStatusHandler handler = new SvnStatusHandler(new SvnStatusHandler.ExternalDataCallback() {

        @Override
        public void switchPath() {
            statuses.add(handlerArr[0].getPending());
            handlerArr[0].getPending().getKind();
        }

        @Override
        public void switchChangeList(String newList) {
        }
    }, new File(basePath), o -> {
        try {
            o.getCanonicalFile();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        if (isWindows) {
            final int idx = o.getPath().indexOf(":");
            Assert.assertTrue(idx > 0);
            final int secondIdx = o.getPath().indexOf(":", idx + 1);
            Assert.assertTrue(o.getPath(), secondIdx == -1);
        } else {
            if (o.getPath().contains(LINUX_ROOT)) {
                Assert.assertFalse(o.getPath().contains(basePath));
            }
        }
        try {
            return createStubInfo(basePath + "1", "http://a.b.c");
        } catch (SVNException e) {
            throw new RuntimeException(e);
        }
    });
    handlerArr[0] = handler;
    final String osChecked = changePathsIfNix(s);
    SAXParser parser = SAXParserFactory.newInstance().newSAXParser();
    parser.parse(new ByteArrayInputStream(osChecked.getBytes(CharsetToolkit.UTF8_CHARSET)), handler);
    final String[] expected = { "root\\source\\s1.txt", "root\\target" };
    for (int i = 0; i < expected.length; i++) {
        expected[i] = FileUtil.toSystemDependentName(expected[i]);
    }
    int cntMatched = 0;
    for (PortableStatus status : statuses) {
        Assert.assertTrue(status.isSwitched());
        final String path = FileUtil.toSystemDependentName(status.getPath());
        for (String s1 : expected) {
            if (s1.equals(path)) {
                ++cntMatched;
                break;
            }
        }
    }
    Assert.assertEquals(2, cntMatched);
}
Also used : PortableStatus(org.jetbrains.idea.svn.status.PortableStatus) IOException(java.io.IOException) SVNException(org.tmatesoft.svn.core.SVNException) ByteArrayInputStream(java.io.ByteArrayInputStream) SvnStatusHandler(org.jetbrains.idea.svn.status.SvnStatusHandler) SAXParser(javax.xml.parsers.SAXParser) File(java.io.File) HashSet(java.util.HashSet)

Example 10 with SVNException

use of org.tmatesoft.svn.core.SVNException in project intellij-community by JetBrains.

the class SvnParseCommandLineParseTest method testStatus.

public void testStatus() throws Exception {
    final String s = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<status>\n" + "<target\n" + "   path=\".\">\n" + "<entry\n" + "   path=\".\">\n" + "<wc-status\n" + "   props=\"normal\"\n" + "   item=\"incomplete\"\n" + "   revision=\"92339\">\n" + "<commit\n" + "   revision=\"91672\">\n" + "<author>qx</author>\n" + "<date>2012-01-27T16:11:06.069351Z</date>\n" + "</commit>\n" + "</wc-status>\n" + "</entry>\n" + "<entry\n" + "   path=\"Decompiler\">\n" + "<wc-status\n" + "   props=\"none\"\n" + "   tree-conflicted=\"true\"\n" + "   item=\"missing\">\n" + "</wc-status>\n" + "</entry>\n" + "<entry\n" + "   path=\"Help\">\n" + "<wc-status\n" + "   props=\"normal\"\n" + "   item=\"incomplete\"\n" + "   revision=\"92339\">\n" + "<commit\n" + "   revision=\"91555\">\n" + "<author>Egor.Malyshev</author>\n" + "<date>2012-01-18T18:05:07.328519Z</date>\n" + "</commit>\n" + "</wc-status>\n" + "</entry>\n" + "<entry\n" + "   path=\"Help\\XML\">\n" + "<wc-status\n" + "   props=\"normal\"\n" + "   item=\"incomplete\"\n" + "   revision=\"92339\">\n" + "<commit\n" + "   revision=\"91555\">\n" + "<author>Egor.Malyshev</author>\n" + "<date>2012-01-18T18:05:07.328519Z</date>\n" + "</commit>\n" + "</wc-status>\n" + "</entry>\n" + "<entry\n" + "   path=\"Help\\XML\\images\">\n" + "<wc-status\n" + "   props=\"normal\"\n" + "   item=\"incomplete\"\n" + "   revision=\"92339\">\n" + "<commit\n" + "   revision=\"91170\">\n" + "<author>Maria.Egorkina</author>\n" + "<date>2011-12-20T13:26:52.217550Z</date>\n" + "</commit>\n" + "</wc-status>\n" + "</entry>\n" + "<entry\n" + "   path=\"Platform\">\n" + "<wc-status\n" + "   props=\"none\"\n" + "   item=\"external\">\n" + "</wc-status>\n" + "</entry>\n" + "<entry\n" + "   path=\"ReSharper.ipr\">\n" + "<wc-status\n" + "   item=\"modified\"\n" + "   revision=\"91677\"\n" + "   props=\"normal\">\n" + "<commit\n" + "   revision=\"87631\">\n" + "<author>Alexey.Kuptsov</author>\n" + "<date>2011-09-30T11:25:10.391467Z</date>\n" + "</commit>\n" + "</wc-status>\n" + "</entry>\n" + "<entry\n" + "   path=\"ReSharper.iws\">\n" + "<wc-status\n" + "   item=\"ignored\"\n" + "   props=\"none\">\n" + "</wc-status>\n" + "</entry>\n" + "<entry\n" + "   path=\"measure.bat\">\n" + "<wc-status\n" + "   item=\"unversioned\"\n" + "   props=\"none\">\n" + "</wc-status>\n" + "</entry>\n" + "<entry\n" + "   path=\"src\\Daemon\\src\\HighlightingBase.cs\">\n" + "<wc-status\n" + "   item=\"deleted\"\n" + "   revision=\"91677\"\n" + "   props=\"none\">\n" + "<commit\n" + "   revision=\"79264\">\n" + "<author>xvost</author>\n" + "<date>2011-02-05T16:06:12.116814Z</date>\n" + "</commit>\n" + "</wc-status>\n" + "</entry>\n" + "<entry\n" + "   path=\"src\\Daemon\\src\\HighlightingBase1.cs\">\n" + "<wc-status\n" + "   props=\"none\"\n" + "   copied=\"true\"\n" + "   item=\"added\">\n" + "<commit\n" + "   revision=\"79264\">\n" + "<author>xvost</author>\n" + "<date>2011-02-05T16:06:12.116814Z</date>\n" + "</commit>\n" + "</wc-status>\n" + "</entry>\n" + "<entry\n" + "   path=\"src\\Decompiler.Core\">\n" + "<wc-status\n" + "   item=\"added\"\n" + "   props=\"normal\"\n" + "   copied=\"true\"\n" + "   tree-conflicted=\"true\">\n" + "<commit\n" + "   revision=\"91559\">\n" + "<author>Leonid.Shalupov</author>\n" + "<date>2012-01-18T19:17:40.876383Z</date>\n" + "</commit>\n" + "</wc-status>\n" + "</entry>\n" + "<entry\n" + "   path=\"src\\Decompiler.Core\\Src\\Transformations\\Loops\\EliminateRedundantContinueTransformation.cs\">\n" + "<wc-status\n" + "   props=\"normal\"\n" + "   copied=\"true\"\n" + "   item=\"modified\">\n" + "<commit\n" + "   revision=\"87972\">\n" + "<author>Slava.Trenogin</author>\n" + "<date>2011-10-06T21:27:41.539022Z</date>\n" + "</commit>\n" + "</wc-status>\n" + "</entry>\n" + "<entry\n" + "   path=\"src\\Decompiler.Core\\Src\\Transformations\\StatementStructure\\ReduceReturnOrYieldBreakTransformation.cs\">\n" + "<wc-status\n" + "   item=\"modified\"\n" + "   props=\"normal\"\n" + "   copied=\"true\">\n" + "<commit\n" + "   revision=\"87972\">\n" + "<author>Slava.Trenogin</author>\n" + "<date>2011-10-06T21:27:41.539022Z</date>\n" + "</commit>\n" + "</wc-status>\n" + "</entry>\n" + "<entry\n" + "   path=\"stat.txt\">\n" + "<wc-status\n" + "   props=\"none\"\n" + "   item=\"unversioned\">\n" + "</wc-status>\n" + "</entry>\n" + "<entry\n" + "   path=\"C:\\TestProjects\\sortedProjects\\Subversion\\Resharper17short\\Platform\\src\\CommonServices\\src\\Services\\CommonServices.cs\">\n" + "<wc-status\n" + "   item=\"modified\"\n" + "   revision=\"92564\"\n" + "   props=\"none\">\n" + "<commit\n" + "   revision=\"73708\">\n" + "<author>Leonid.Shalupov</author>\n" + "<date>2010-09-10T14:14:04.090943Z</date>\n" + "</commit>\n" + "</wc-status>\n" + "</entry>\n" + "<entry\n" + "   path=\"C:\\TestProjects\\sortedProjects\\Subversion\\Resharper17short\\Platform\\src\\Document.Tests\\AssemblyInfo.cs\">\n" + "<wc-status\n" + "   item=\"modified\"\n" + "   revision=\"92564\"\n" + "   props=\"none\">\n" + "<commit\n" + "   revision=\"86795\">\n" + "<author>Leonid.Shalupov</author>\n" + "<date>2011-09-11T13:54:16.917943Z</date>\n" + "</commit>\n" + "</wc-status>\n" + "</entry>\n" + "<entry\n" + "   path=\"C:\\TestProjects\\sortedProjects\\Subversion\\Resharper17short\\Platform\\src\\Document.Tests\\RangeMarkerTest.cs\">\n" + "<wc-status\n" + "   props=\"none\"\n" + "   item=\"modified\"\n" + "   revision=\"92564\">\n" + "<commit\n" + "   revision=\"77688\">\n" + "<author>Alexander.Zverev</author>\n" + "<date>2010-12-14T15:56:38.322018Z</date>\n" + "</commit>\n" + "</wc-status>\n" + "</entry>\n" + "<entry\n" + "   path=\"C:\\TestProjects\\sortedProjects\\Subversion\\Resharper17short\\Platform\\src\\Metadata\\AssemblyInfo.cs\">\n" + "<wc-status\n" + "   item=\"modified\"\n" + "   revision=\"92564\"\n" + "   props=\"none\">\n" + "<commit\n" + "   revision=\"82127\">\n" + "<author>Leonid.Shalupov</author>\n" + "<date>2011-04-13T20:57:30.828600Z</date>\n" + "</commit>\n" + "</wc-status>\n" + "</entry>\n" + "<entry\n" + "   path=\"C:\\TestProjects\\sortedProjects\\Subversion\\Resharper17short\\Platform\\src\\Metadata\\src\\Utils\\AssemblyNameInfo.cs\">\n" + "<wc-status\n" + "   item=\"modified\"\n" + "   revision=\"92564\"\n" + "   props=\"none\">\n" + "<commit\n" + "   revision=\"90865\">\n" + "<author>xvost</author>\n" + "<date>2011-12-13T13:10:30.902950Z</date>\n" + "</commit>\n" + "</wc-status>\n" + "</entry>\n" + "<entry\n" + "   path=\"C:\\TestProjects\\sortedProjects\\Subversion\\Resharper17short\\Platform\\src\\Metadata\\src\\Utils\\BinaryBlobExtensions.cs\">\n" + "<wc-status\n" + "   item=\"modified\"\n" + "   revision=\"92564\"\n" + "   props=\"none\">\n" + "<commit\n" + "   revision=\"74075\">\n" + "<author>Leonid.Shalupov</author>\n" + "<date>2010-09-17T09:32:30.827654Z</date>\n" + "</commit>\n" + "</wc-status>\n" + "</entry>\n" + "<entry\n" + "   path=\"C:\\TestProjects\\sortedProjects\\Subversion\\Resharper17short\\Platform\\src\\Metadata\\src\\Utils\\BinaryBlobReader.cs\">\n" + "<wc-status\n" + "   props=\"none\"\n" + "   item=\"modified\"\n" + "   revision=\"92564\">\n" + "<commit\n" + "   revision=\"74075\">\n" + "<author>Leonid.Shalupov</author>\n" + "<date>2010-09-17T09:32:30.827654Z</date>\n" + "</commit>\n" + "</wc-status>\n" + "</entry>\n" + "<entry\n" + "   path=\"C:\\TestProjects\\sortedProjects\\Subversion\\Resharper17short\\Platform\\src\\Metadata\\src\\Utils\\BinaryBlobStream.cs\">\n" + "<wc-status\n" + "   props=\"none\"\n" + "   item=\"modified\"\n" + "   revision=\"92564\">\n" + "<commit\n" + "   revision=\"74075\">\n" + "<author>Leonid.Shalupov</author>\n" + "<date>2010-09-17T09:32:30.827654Z</date>\n" + "</commit>\n" + "</wc-status>\n" + "</entry>\n" + "<entry\n" + "   path=\"C:\\TestProjects\\sortedProjects\\Subversion\\Resharper17short\\Platform\\src\\Metadata\\src\\Utils\\BlobOnReader.cs\">\n" + "<wc-status\n" + "   item=\"modified\"\n" + "   revision=\"92564\"\n" + "   props=\"none\">\n" + "<commit\n" + "   revision=\"74075\">\n" + "<author>Leonid.Shalupov</author>\n" + "<date>2010-09-17T09:32:30.827654Z</date>\n" + "</commit>\n" + "</wc-status>\n" + "</entry>\n" + "<entry\n" + "   path=\"C:\\TestProjects\\sortedProjects\\Subversion\\Resharper17short\\Platform\\src\\Metadata\\src\\Utils\\ComStreamWrapper.cs\">\n" + "<wc-status\n" + "   item=\"modified\"\n" + "   revision=\"92564\"\n" + "   props=\"none\">\n" + "<commit\n" + "   revision=\"91348\">\n" + "<author>Sergey.Shkredov</author>\n" + "<date>2012-01-09T11:26:53.770349Z</date>\n" + "</commit>\n" + "</wc-status>\n" + "</entry>\n" + "<entry\n" + "   path=\"C:\\TestProjects\\sortedProjects\\Subversion\\Resharper17short\\Platform\\src\\Metadata\\src\\Utils\\EmptyBlob.cs\">\n" + "<wc-status\n" + "   props=\"none\"\n" + "   item=\"modified\"\n" + "   revision=\"92564\">\n" + "<commit\n" + "   revision=\"74075\">\n" + "<author>Leonid.Shalupov</author>\n" + "<date>2010-09-17T09:32:30.827654Z</date>\n" + "</commit>\n" + "</wc-status>\n" + "</entry>\n" + "<entry\n" + "   path=\"C:\\TestProjects\\sortedProjects\\Subversion\\Resharper17short\\Platform\\src\\Metadata\\src\\Utils\\GAC.cs\">\n" + "<wc-status\n" + "   props=\"normal\"\n" + "   item=\"modified\"\n" + "   revision=\"92564\">\n" + "<commit\n" + "   revision=\"75626\">\n" + "<author>Slava.Trenogin</author>\n" + "<date>2010-10-21T07:41:45.036722Z</date>\n" + "</commit>\n" + "</wc-status>\n" + "</entry>\n" + "<entry\n" + "   path=\"C:\\TestProjects\\sortedProjects\\Subversion\\Resharper17short\\Platform\\src\\Metadata\\src\\Utils\\GacUtil.cs\">\n" + "<wc-status\n" + "   props=\"none\"\n" + "   item=\"modified\"\n" + "   revision=\"92564\">\n" + "<commit\n" + "   revision=\"91646\">\n" + "<author>Leonid.Shalupov</author>\n" + "<date>2012-01-21T19:08:04.108471Z</date>\n" + "</commit>\n" + "</wc-status>\n" + "</entry>\n" + "<entry\n" + "   path=\"C:\\TestProjects\\sortedProjects\\Subversion\\Resharper17short\\Platform\\src\\Metadata\\src\\Utils\\IBinaryReader.cs\">\n" + "<wc-status\n" + "   item=\"modified\"\n" + "   revision=\"92564\"\n" + "   props=\"none\">\n" + "<commit\n" + "   revision=\"71390\">\n" + "<author>Leonid.Shalupov</author>\n" + "<date>2010-07-12T18:29:27.763006Z</date>\n" + "</commit>\n" + "</wc-status>\n" + "</entry>\n" + "<entry\n" + "   path=\"C:\\TestProjects\\sortedProjects\\Subversion\\Resharper17short\\Platform\\src\\Metadata\\src\\Utils\\IntInterval.cs\">\n" + "<wc-status\n" + "   item=\"modified\"\n" + "   revision=\"92564\"\n" + "   props=\"none\">\n" + "<commit\n" + "   revision=\"55567\">\n" + "<author>qx</author>\n" + "<date>2009-06-03T10:11:14.985037Z</date>\n" + "</commit>\n" + "</wc-status>\n" + "</entry>\n" + "<entry\n" + "   path=\"C:\\TestProjects\\sortedProjects\\Subversion\\Resharper17short\\Platform\\src\\Metadata\\src\\Utils\\ManifestResourceUtil.cs\">\n" + "<wc-status\n" + "   props=\"none\"\n" + "   item=\"modified\"\n" + "   revision=\"92564\">\n" + "<commit\n" + "   revision=\"87972\">\n" + "<author>Slava.Trenogin</author>\n" + "<date>2011-10-06T21:27:41.539022Z</date>\n" + "</commit>\n" + "</wc-status>\n" + "</entry>\n" + "<entry\n" + "   path=\"C:\\TestProjects\\sortedProjects\\Subversion\\Resharper17short\\Platform\\src\\Metadata\\src\\Utils\\MarshalSpecParser.cs\">\n" + "<wc-status\n" + "   item=\"modified\"\n" + "   revision=\"92564\"\n" + "   props=\"none\">\n" + "<commit\n" + "   revision=\"76982\">\n" + "<author>Leonid.Shalupov</author>\n" + "<date>2010-11-28T10:16:36.309593Z</date>\n" + "</commit>\n" + "</wc-status>\n" + "</entry>\n" + "<entry\n" + "   path=\"C:\\TestProjects\\sortedProjects\\Subversion\\Resharper17short\\Platform\\src\\Metadata\\src\\Utils\\MetadataHelpers.cs\">\n" + "<wc-status\n" + "   props=\"none\"\n" + "   item=\"modified\"\n" + "   revision=\"92564\">\n" + "<commit\n" + "   revision=\"91348\">\n" + "<author>Sergey.Shkredov</author>\n" + "<date>2012-01-09T11:26:53.770349Z</date>\n" + "</commit>\n" + "</wc-status>\n" + "</entry>\n" + "<entry\n" + "   path=\"C:\\TestProjects\\sortedProjects\\Subversion\\Resharper17short\\Platform\\src\\Metadata\\src\\Utils\\ModuleQualificationUtil.cs\">\n" + "<wc-status\n" + "   props=\"none\"\n" + "   item=\"modified\"\n" + "   revision=\"92564\">\n" + "<commit\n" + "   revision=\"60918\">\n" + "<author>xvost</author>\n" + "<date>2009-11-03T10:42:37.363952Z</date>\n" + "</commit>\n" + "</wc-status>\n" + "</entry>\n" + "<entry\n" + "   path=\"C:\\TestProjects\\sortedProjects\\Subversion\\Resharper17short\\Platform\\src\\Metadata\\src\\Utils\\StreamBinaryReader.cs\">\n" + "<wc-status\n" + "   item=\"modified\"\n" + "   revision=\"92564\"\n" + "   props=\"none\">\n" + "<commit\n" + "   revision=\"71390\">\n" + "<author>Leonid.Shalupov</author>\n" + "<date>2010-07-12T18:29:27.763006Z</date>\n" + "</commit>\n" + "</wc-status>\n" + "</entry>\n" + "<entry\n" + "   path=\"C:\\TestProjects\\sortedProjects\\Subversion\\Resharper17short\\Platform\\src\\Metadata\\src\\Utils\\SubStream.cs\">\n" + "<wc-status\n" + "   item=\"modified\"\n" + "   revision=\"92564\"\n" + "   props=\"none\">\n" + "<commit\n" + "   revision=\"76725\">\n" + "<author>Leonid.Shalupov</author>\n" + "<date>2010-11-20T13:23:44.172899Z</date>\n" + "</commit>\n" + "</wc-status>\n" + "</entry>\n" + "</target>\n" + "<changelist\n" + "   name=\"ads\">\n" + "<entry\n" + "   path=\"BuildVsix.cmd\">\n" + "<wc-status\n" + "   item=\"modified\"\n" + "   revision=\"91677\"\n" + "   props=\"none\">\n" + "<commit\n" + "   revision=\"77579\">\n" + "<author>Victor.Kropp</author>\n" + "<date>2010-12-13T11:06:36.141754Z</date>\n" + "</commit>\n" + "</wc-status>\n" + "</entry>\n" + "</changelist>\n" + "</status>\n";
    final SvnStatusHandler[] handlerArr = new SvnStatusHandler[1];
    final boolean isWindows = SystemInfo.isWindows;
    final String basePath = isWindows ? "C:/base/" : "/base33729/";
    final SvnStatusHandler handler = new SvnStatusHandler(new SvnStatusHandler.ExternalDataCallback() {

        @Override
        public void switchPath() {
            handlerArr[0].getPending().getKind();
        }

        @Override
        public void switchChangeList(String newList) {
        }
    }, new File(basePath), o -> {
        try {
            o.getCanonicalFile();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        if (isWindows) {
            final int idx = o.getPath().indexOf(":");
            Assert.assertTrue(idx > 0);
            final int secondIdx = o.getPath().indexOf(":", idx + 1);
            Assert.assertTrue(o.getPath(), secondIdx == -1);
        } else {
            if (o.getPath().contains(LINUX_ROOT)) {
                Assert.assertFalse(o.getPath().contains(basePath));
            }
        }
        try {
            return createStubInfo(basePath + "1", "http://a.b.c");
        } catch (SVNException e) {
            throw new RuntimeException(e);
        }
    });
    handlerArr[0] = handler;
    final String osChecked = changePathsIfNix(s);
    SAXParser parser = SAXParserFactory.newInstance().newSAXParser();
    parser.parse(new ByteArrayInputStream(osChecked.getBytes(CharsetToolkit.UTF8_CHARSET)), handler);
    final MultiMap<String, PortableStatus> changes = handler.getCurrentListChanges();
}
Also used : PortableStatus(org.jetbrains.idea.svn.status.PortableStatus) IOException(java.io.IOException) SVNException(org.tmatesoft.svn.core.SVNException) ByteArrayInputStream(java.io.ByteArrayInputStream) SvnStatusHandler(org.jetbrains.idea.svn.status.SvnStatusHandler) SAXParser(javax.xml.parsers.SAXParser) File(java.io.File)

Aggregations

SVNException (org.tmatesoft.svn.core.SVNException)95 File (java.io.File)37 SVNURL (org.tmatesoft.svn.core.SVNURL)37 VcsException (com.intellij.openapi.vcs.VcsException)18 SvnBindException (org.jetbrains.idea.svn.commandLine.SvnBindException)14 SVNConfigFile (org.tmatesoft.svn.core.internal.wc.SVNConfigFile)14 IOException (java.io.IOException)8 ArrayList (java.util.ArrayList)8 Collection (java.util.Collection)8 List (java.util.List)8 VirtualFile (com.intellij.openapi.vfs.VirtualFile)7 DefaultSVNOptions (org.tmatesoft.svn.core.internal.wc.DefaultSVNOptions)7 SVNRepository (org.tmatesoft.svn.core.io.SVNRepository)7 SVNRevision (org.tmatesoft.svn.core.wc.SVNRevision)7 Date (java.util.Date)6 NotNull (org.jetbrains.annotations.NotNull)6 SVNCancelException (org.tmatesoft.svn.core.SVNCancelException)6 SVNLogEntry (org.tmatesoft.svn.core.SVNLogEntry)6 ProgressIndicator (com.intellij.openapi.progress.ProgressIndicator)5 ByteArrayInputStream (java.io.ByteArrayInputStream)5