This commit is contained in:
Vladimir Krivosheev
2013-10-02 17:22:22 +02:00
parent 6126ecb987
commit 420e6f7a2f
5 changed files with 11 additions and 21 deletions
@@ -16,7 +16,6 @@
package com.intellij.openapi.vcs;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.diff.impl.patch.formove.FilePathComparator;
import com.intellij.openapi.options.Configurable;
import com.intellij.openapi.options.UnnamedConfigurable;
@@ -59,7 +58,6 @@ import java.util.List;
public abstract class AbstractVcs<ComList extends CommittedChangeList> extends StartedActivated {
// true is default
private static final String USE_ANNOTATION_CACHE = "vcs.use.annotation.cache";
private static final Logger LOG = Logger.getInstance("#com.intellij.openapi.vcs.AbstractVcs");
@NonNls protected static final String ourIntegerPattern = "\\d+";
@@ -27,7 +27,7 @@ import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.vcs.*;
import com.intellij.openapi.vcs.actions.VcsContextFactory;
import com.intellij.openapi.vfs.LocalFileSystem;
import com.intellij.openapi.vfs.VfsUtil;
import com.intellij.openapi.vfs.VfsUtilCore;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.pom.Navigatable;
import org.jetbrains.annotations.NotNull;
@@ -40,7 +40,7 @@ import java.util.*;
* @author max
*/
public class ChangesUtil {
private static final Key<Boolean> INTERNAL_OPERATION_KEY = Key.<Boolean>create("internal vcs operation");
private static final Key<Boolean> INTERNAL_OPERATION_KEY = Key.create("internal vcs operation");
private ChangesUtil() {}
@@ -148,7 +148,7 @@ public class ChangesUtil {
}
}
}
return VfsUtil.toVirtualFileArray(files);
return VfsUtilCore.toVirtualFileArray(files);
}
public static Navigatable[] getNavigatableArray(final Project project, final VirtualFile[] selectedFiles) {
@@ -207,6 +207,7 @@ public class ChangesUtil {
public static FilePath getLocalPath(final Project project, final FilePath filePath) {
// check if the file has just been renamed (IDEADEV-15494)
Change change = ApplicationManager.getApplication().runReadAction(new Computable<Change>() {
@Override
@Nullable
public Change compute() {
if (project.isDisposed()) throw new ProcessCanceledException();
@@ -255,6 +256,7 @@ public class ChangesUtil {
private static VirtualFile getValidParentUnderReadAction(final FilePath filePath) {
return ApplicationManager.getApplication().runReadAction(new Computable<VirtualFile>() {
@Override
public VirtualFile compute() {
return findValidParent(filePath);
}
@@ -326,6 +328,7 @@ public class ChangesUtil {
final Map<AbstractVcs, List<T>> changesByVcs = new HashMap<AbstractVcs, List<T>>();
ApplicationManager.getApplication().runReadAction(new Runnable() {
@Override
public void run() {
for (T item : items) {
final AbstractVcs vcs = separator.getVcsFor(item);
@@ -348,6 +351,7 @@ public class ChangesUtil {
public static void processChangesByVcs(final Project project, Collection<Change> changes, PerVcsProcessor<Change> processor) {
processItemsByVcs(changes, new VcsSeparator<Change>() {
@Override
public AbstractVcs getVcsFor(final Change item) {
return getVcsForChange(item, project);
}
@@ -356,6 +360,7 @@ public class ChangesUtil {
public static void processVirtualFilesByVcs(final Project project, Collection<VirtualFile> files, PerVcsProcessor<VirtualFile> processor) {
processItemsByVcs(files, new VcsSeparator<VirtualFile>() {
@Override
public AbstractVcs getVcsFor(final VirtualFile item) {
return getVcsForFile(item, project);
}
@@ -364,6 +369,7 @@ public class ChangesUtil {
public static void processFilePathsByVcs(final Project project, Collection<FilePath> files, PerVcsProcessor<FilePath> processor) {
processItemsByVcs(files, new VcsSeparator<FilePath>() {
@Override
public AbstractVcs getVcsFor(final FilePath item) {
return getVcsForFile(item.getIOFile(), project);
}
@@ -380,7 +386,7 @@ public class ChangesUtil {
public static boolean hasFileChanges(final Collection<Change> changes) {
for(Change change: changes) {
FilePath path = ChangesUtil.getFilePath(change);
FilePath path = getFilePath(change);
if (!path.isDirectory()) {
return true;
}
@@ -21,21 +21,12 @@ import com.intellij.openapi.vcs.changes.CommitContext;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
* @author irengrig
* Date: 1/28/11
* Time: 3:09 PM
*
* just interface for checkin handlers creation
*/
public interface BaseCheckinHandlerFactory {
/**
* Creates a handler for a single Checkin Project or Checkin File operation.
*
*
* @param panel the class which can be used to retrieve information about the files to be committed,
* and to get or set the commit message.
* @param commitContext
* @return the handler instance.
*/
@NotNull
@@ -31,7 +31,6 @@ import org.jetbrains.annotations.NotNull;
* and unregistered in {@link com.intellij.openapi.vcs.AbstractVcs#deactivate()}
*
* @author lesya
* @see com.intellij.openapi.vcs.ProjectLevelVcsManager#registerCheckinHandlerFactory(BaseCheckinHandlerFactory)
* @since 5.1
*/
public abstract class CheckinHandlerFactory implements BaseCheckinHandlerFactory {
@@ -44,6 +43,7 @@ public abstract class CheckinHandlerFactory implements BaseCheckinHandlerFactory
* and to get or set the commit message.
* @return the handler instance.
*/
@Override
@NotNull
public abstract CheckinHandler createHandler(final CheckinProjectPanel panel, CommitContext commitContext);
@@ -22,11 +22,6 @@ import com.intellij.openapi.vcs.VcsKey;
import com.intellij.openapi.vcs.changes.CommitContext;
import org.jetbrains.annotations.NotNull;
/**
* @author irengrig
* Date: 1/28/11
* Time: 3:49 PM
*/
public abstract class VcsCheckinHandlerFactory implements BaseCheckinHandlerFactory {
public static final ExtensionPointName<VcsCheckinHandlerFactory> EP_NAME = ExtensionPointName.create("com.intellij.vcsCheckinHandlerFactory");