Search in sources :

Example 1 with Depth

use of org.jetbrains.idea.svn.api.Depth in project intellij-community by JetBrains.

the class OneShotMergeInfoHelper method prepare.

@Override
public void prepare() throws VcsException {
    Depth depth = Depth.allOrEmpty(myMergeContext.getVcs().getSvnConfiguration().isCheckNestedForQuickMerge());
    File file = myMergeContext.getWcInfo().getRootInfo().getIoFile();
    myMergeContext.getVcs().getFactory(file).createPropertyClient().getProperty(SvnTarget.fromFile(file), SvnPropertyKeys.MERGE_INFO, SVNRevision.WORKING, depth, createPropertyHandler());
}
Also used : File(java.io.File) Depth(org.jetbrains.idea.svn.api.Depth)

Example 2 with Depth

use of org.jetbrains.idea.svn.api.Depth in project intellij-community by JetBrains.

the class SvnRecursiveStatusWalker method processRecursively.

private void processRecursively(@NotNull VirtualFile vFile, @NotNull Depth prevDepth) {
    if (Depth.EMPTY.equals(prevDepth))
        return;
    if (isIgnoredIdeaLevel(vFile)) {
        myReceiver.processIgnored(vFile);
        return;
    }
    Depth newDepth = Depth.INFINITY.equals(prevDepth) ? Depth.INFINITY : Depth.EMPTY;
    VirtualFileVisitor.Option[] options = newDepth.equals(Depth.EMPTY) ? ar(SKIP_ROOT, ONE_LEVEL_DEEP) : new VirtualFileVisitor.Option[0];
    visitChildrenRecursively(vFile, new VirtualFileVisitor(options) {

        @NotNull
        @Override
        public Result visitFileEx(@NotNull VirtualFile file) {
            if (isIgnoredIdeaLevel(file)) {
                myReceiver.processIgnored(file);
                return SKIP_CHILDREN;
            } else if (file.isDirectory() && file.findChild(SvnUtil.SVN_ADMIN_DIR_NAME) != null) {
                myQueue.add(createItem(VcsUtil.getFilePath(file), newDepth, true));
                return SKIP_CHILDREN;
            } else {
                myReceiver.processUnversioned(file);
                return CONTINUE;
            }
        }
    });
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) VirtualFileVisitor(com.intellij.openapi.vfs.VirtualFileVisitor) NotNull(org.jetbrains.annotations.NotNull) Depth(org.jetbrains.idea.svn.api.Depth)

Example 3 with Depth

use of org.jetbrains.idea.svn.api.Depth in project intellij-community by JetBrains.

the class SvnCheckinEnvironment method scheduleUnversionedFilesForAddition.

public static List<VcsException> scheduleUnversionedFilesForAddition(@NotNull SvnVcs vcs, List<VirtualFile> files, final boolean recursive) {
    Collections.sort(files, FilePathComparator.getInstance());
    ProgressTracker eventHandler = new SvnProgressCanceller() {

        @Override
        public void consume(ProgressEvent event) throws SVNException {
            // TODO: indicator is null here when invoking "Add" action
            ProgressIndicator indicator = ProgressManager.getInstance().getProgressIndicator();
            File file = event.getFile();
            if (indicator != null && file != null) {
                indicator.setText(SvnBundle.message("progress.text2.adding", file.getName() + " (" + file.getParent() + ")"));
            }
        }
    };
    List<VcsException> exceptions = new ArrayList<>();
    Depth depth = Depth.allOrEmpty(recursive);
    for (VirtualFile file : files) {
        try {
            File convertedFile = VfsUtilCore.virtualToIoFile(file);
            vcs.getFactory(convertedFile).createAddClient().add(convertedFile, depth, true, false, true, eventHandler);
        } catch (VcsException e) {
            exceptions.add(e);
        }
    }
    return exceptions;
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) ProgressTracker(org.jetbrains.idea.svn.api.ProgressTracker) ProgressIndicator(com.intellij.openapi.progress.ProgressIndicator) VcsException(com.intellij.openapi.vcs.VcsException) ProgressEvent(org.jetbrains.idea.svn.api.ProgressEvent) VirtualFile(com.intellij.openapi.vfs.VirtualFile) File(java.io.File) Depth(org.jetbrains.idea.svn.api.Depth)

Aggregations

Depth (org.jetbrains.idea.svn.api.Depth)3 VirtualFile (com.intellij.openapi.vfs.VirtualFile)2 File (java.io.File)2 ProgressIndicator (com.intellij.openapi.progress.ProgressIndicator)1 VcsException (com.intellij.openapi.vcs.VcsException)1 VirtualFileVisitor (com.intellij.openapi.vfs.VirtualFileVisitor)1 NotNull (org.jetbrains.annotations.NotNull)1 ProgressEvent (org.jetbrains.idea.svn.api.ProgressEvent)1 ProgressTracker (org.jetbrains.idea.svn.api.ProgressTracker)1