// Path: SVNToolBox/src/main/java/zielu/svntoolbox/util/LogStopwatch.java
// public abstract class LogStopwatch {
//   private static final Logger LOG = getInstance("#zielu.svntoolbox.perf");
//   ;
//   private final Supplier<String> myNameSupplier;
//   @Nullable
//   private final Supplier<Integer> mySequence;
//   private final Stopwatch myStopwatch = Stopwatch.createUnstarted();
// 
//   private String myName;
// 
//   protected LogStopwatch(@Nullable Supplier<Integer> sequence, Supplier<String> nameSupplier) {
//     myNameSupplier = nameSupplier;
//     mySequence = sequence;
//   }
// 
//   public static LogStopwatch debugStopwatch(Supplier<String> nameSupplier) {
//     return new DebugStopwatch(null, nameSupplier);
//   }
// 
//   public static LogStopwatch debugStopwatch(Supplier<Integer> sequence, Supplier<String> nameSupplier) {
//     return new DebugStopwatch(sequence, nameSupplier);
//   }
// 
//   public LogStopwatch start() {
//     if (isEnabled()) {
//       myStopwatch.start();
//       myName = myNameSupplier.get();
//     }
//     return this;
//   }
// 
//   private String prepareName(String prefix) {
//     return "[" + prefix + ":" + myName + (mySequence != null ? "|" + mySequence.get() : "") + "]";
//   }
// 
//   public void tick(String message, Object... args) {
//     if (isEnabled()) {
//       long time = myStopwatch.elapsed(TimeUnit.MILLISECONDS);
//       String formattedMessage = MessageFormat.format(message, args);
//       log(prepareName("T") + " " + formattedMessage + " [" + time + " ms]");
//     }
//   }
// 
//   public void stop() {
//     if (isEnabled()) {
//       myStopwatch.stop();
//       log(prepareName("S") + " stopped [" + myStopwatch.elapsed(TimeUnit.MILLISECONDS) + " ms]");
//     }
//   }
// 
//   protected abstract boolean isEnabled();
// 
//   protected abstract void log(String message);
// 
//   private static class DebugStopwatch extends LogStopwatch {
// 
//     protected DebugStopwatch(@Nullable Supplier<Integer> sequence, Supplier<String> nameSupplier) {
//       super(sequence, nameSupplier);
//     }
// 
//     @Override
//     protected boolean isEnabled() {
//       return LOG.isDebugEnabled();
//     }
// 
//     @Override
//     protected void log(String message) {
//       LOG.debug(message);
//     }
//   }
// }


import com.google.common.collect.Lists;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vcs.ProjectLevelVcsManager;
import com.intellij.openapi.vfs.VfsUtilCore;
import com.intellij.openapi.vfs.VirtualFile;
import java.io.File;
import java.util.Collection;
import java.util.List;
import java.util.Optional;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.SvnConfiguration;
import org.jetbrains.idea.svn.SvnStatusUtil;
import org.jetbrains.idea.svn.SvnUtil;
import org.jetbrains.idea.svn.SvnVcs;
import org.jetbrains.idea.svn.api.Url;
import org.jetbrains.idea.svn.branchConfig.SvnBranchConfigurationManager;
import org.jetbrains.idea.svn.branchConfig.SvnBranchConfigurationNew;
import org.jetbrains.idea.svn.info.Info;
import zielu.svntoolbox.util.LogStopwatch;
                    }
                }
            }
        }
        return result;
    }
    
    @NotNull
    public FileStatus statusFor(@Nullable Project project, @NotNull VirtualFile vFile) {
        if (project == null) {
            return FileStatus.EMPTY;
        }
        SvnVcs svn = SvnVcs.getInstance(project);
        return statusFor(svn, project, vFile);        
    }

    private Optional<VirtualFile> getWCRoot(File currentFile) {
        //TODO: there is also #getWorkingCopyRootNew for Svn 1.8
        File root = SvnUtil.getWorkingCopyRootNew(currentFile);
        if (root == null) {
          LOG.debug("WC root not found for: file=", currentFile.getAbsolutePath());
          return Optional.empty();
        } else {
            VirtualFile rootVf = SvnUtil.getVirtualFile(root.getPath());
            assert rootVf != null: "Root VF not found for: "+root.getPath();
            return Optional.of(rootVf); 
        } 
    }

    private Optional<FileStatus> statusForCli(Project project, Url fileUrl, File currentFile) {
// Path: SVNToolBox/src/main/java/zielu/svntoolbox/util/LogStopwatch.java
// public abstract class LogStopwatch {
//   private static final Logger LOG = getInstance("#zielu.svntoolbox.perf");
//   ;
//   private final Supplier<String> myNameSupplier;
//   @Nullable
//   private final Supplier<Integer> mySequence;
//   private final Stopwatch myStopwatch = Stopwatch.createUnstarted();
// 
//   private String myName;
// 
//   protected LogStopwatch(@Nullable Supplier<Integer> sequence, Supplier<String> nameSupplier) {
//     myNameSupplier = nameSupplier;
//     mySequence = sequence;
//   }
// 
//   public static LogStopwatch debugStopwatch(Supplier<String> nameSupplier) {
//     return new DebugStopwatch(null, nameSupplier);
//   }
// 
//   public static LogStopwatch debugStopwatch(Supplier<Integer> sequence, Supplier<String> nameSupplier) {
//     return new DebugStopwatch(sequence, nameSupplier);
//   }
// 
//   public LogStopwatch start() {
//     if (isEnabled()) {
//       myStopwatch.start();
//       myName = myNameSupplier.get();
//     }
//     return this;
//   }
// 
//   private String prepareName(String prefix) {
//     return "[" + prefix + ":" + myName + (mySequence != null ? "|" + mySequence.get() : "") + "]";
//   }
// 
//   public void tick(String message, Object... args) {
//     if (isEnabled()) {
//       long time = myStopwatch.elapsed(TimeUnit.MILLISECONDS);
//       String formattedMessage = MessageFormat.format(message, args);
//       log(prepareName("T") + " " + formattedMessage + " [" + time + " ms]");
//     }
//   }
// 
//   public void stop() {
//     if (isEnabled()) {
//       myStopwatch.stop();
//       log(prepareName("S") + " stopped [" + myStopwatch.elapsed(TimeUnit.MILLISECONDS) + " ms]");
//     }
//   }
// 
//   protected abstract boolean isEnabled();
// 
//   protected abstract void log(String message);
// 
//   private static class DebugStopwatch extends LogStopwatch {
// 
//     protected DebugStopwatch(@Nullable Supplier<Integer> sequence, Supplier<String> nameSupplier) {
//       super(sequence, nameSupplier);
//     }
// 
//     @Override
//     protected boolean isEnabled() {
//       return LOG.isDebugEnabled();
//     }
// 
//     @Override
//     protected void log(String message) {
//       LOG.debug(message);
//     }
//   }
// }


// Path: SVNToolBox/src/main/java/zielu/svntoolbox/FileStatusCalculator.java
import com.google.common.collect.Lists;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vcs.ProjectLevelVcsManager;
import com.intellij.openapi.vfs.VfsUtilCore;
import com.intellij.openapi.vfs.VirtualFile;
import java.io.File;
import java.util.Collection;
import java.util.List;
import java.util.Optional;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.SvnConfiguration;
import org.jetbrains.idea.svn.SvnStatusUtil;
import org.jetbrains.idea.svn.SvnUtil;
import org.jetbrains.idea.svn.SvnVcs;
import org.jetbrains.idea.svn.api.Url;
import org.jetbrains.idea.svn.branchConfig.SvnBranchConfigurationManager;
import org.jetbrains.idea.svn.branchConfig.SvnBranchConfigurationNew;
import org.jetbrains.idea.svn.info.Info;
import zielu.svntoolbox.util.LogStopwatch;

                    }
                }
            }
        }
        return result;
    }
    
    @NotNull
    public FileStatus statusFor(@Nullable Project project, @NotNull VirtualFile vFile) {
        if (project == null) {
            return FileStatus.EMPTY;
        }
        SvnVcs svn = SvnVcs.getInstance(project);
        return statusFor(svn, project, vFile);        
    }

    private Optional<VirtualFile> getWCRoot(File currentFile) {
        //TODO: there is also #getWorkingCopyRootNew for Svn 1.8
        File root = SvnUtil.getWorkingCopyRootNew(currentFile);
        if (root == null) {
          LOG.debug("WC root not found for: file=", currentFile.getAbsolutePath());
          return Optional.empty();
        } else {
            VirtualFile rootVf = SvnUtil.getVirtualFile(root.getPath());
            assert rootVf != null: "Root VF not found for: "+root.getPath();
            return Optional.of(rootVf); 
        } 
    }

    private Optional<FileStatus> statusForCli(Project project, Url fileUrl, File currentFile) {
        LogStopwatch watch = LogStopwatch.debugStopwatch(SvnToolBoxProject.getInstance(project).sequence(),