Search in sources :

Example 1 with SvnExceptionWrapper

use of org.jetbrains.idea.svn.commandLine.SvnExceptionWrapper in project intellij-community by JetBrains.

the class SvnChangeProvider method getChanges.

public void getChanges(@NotNull VcsDirtyScope dirtyScope, @NotNull ChangelistBuilder builder, @NotNull ProgressIndicator progress, @NotNull ChangeListManagerGate addGate) throws VcsException {
    final SvnScopeZipper zipper = new SvnScopeZipper(dirtyScope);
    zipper.run();
    final Map<String, SvnScopeZipper.MyDirNonRecursive> nonRecursiveMap = zipper.getNonRecursiveDirs();
    final ISVNStatusFileProvider fileProvider = createFileProvider(nonRecursiveMap);
    try {
        final SvnChangeProviderContext context = new SvnChangeProviderContext(myVcs, builder, progress);
        final NestedCopiesBuilder nestedCopiesBuilder = new NestedCopiesBuilder(myVcs, mySvnFileUrlMapping);
        final EventDispatcher<StatusReceiver> statusReceiver = EventDispatcher.create(StatusReceiver.class);
        statusReceiver.addListener(context);
        statusReceiver.addListener(nestedCopiesBuilder);
        final SvnRecursiveStatusWalker walker = new SvnRecursiveStatusWalker(myVcs, statusReceiver.getMulticaster(), progress);
        for (FilePath path : zipper.getRecursiveDirs()) {
            walker.go(path, Depth.INFINITY);
        }
        walker.setFileProvider(fileProvider);
        for (SvnScopeZipper.MyDirNonRecursive item : nonRecursiveMap.values()) {
            walker.go(item.getDir(), Depth.IMMEDIATES);
        }
        statusReceiver.getMulticaster().finish();
        processCopiedAndDeleted(context, dirtyScope);
        processUnsaved(dirtyScope, addGate, context);
        final Set<NestedCopyInfo> nestedCopies = nestedCopiesBuilder.getCopies();
        mySvnFileUrlMapping.acceptNestedData(nestedCopies);
        putAdministrative17UnderVfsListener(nestedCopies);
    } catch (SvnExceptionWrapper e) {
        LOG.info(e);
        throw new VcsException(e.getCause());
    } catch (SVNException e) {
        if (e.getCause() != null) {
            throw new VcsException(e.getMessage() + " " + e.getCause().getMessage(), e);
        }
        throw new VcsException(e);
    }
}
Also used : FilePath(com.intellij.openapi.vcs.FilePath) ISVNStatusFileProvider(org.tmatesoft.svn.core.wc.ISVNStatusFileProvider) SVNException(org.tmatesoft.svn.core.SVNException) VcsException(com.intellij.openapi.vcs.VcsException) SvnExceptionWrapper(org.jetbrains.idea.svn.commandLine.SvnExceptionWrapper)

Aggregations

FilePath (com.intellij.openapi.vcs.FilePath)1 VcsException (com.intellij.openapi.vcs.VcsException)1 SvnExceptionWrapper (org.jetbrains.idea.svn.commandLine.SvnExceptionWrapper)1 SVNException (org.tmatesoft.svn.core.SVNException)1 ISVNStatusFileProvider (org.tmatesoft.svn.core.wc.ISVNStatusFileProvider)1