mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Cleanup (deprecated VCS change list API dropped)
This commit is contained in:
+10
-14
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2009 JetBrains s.r.o.
|
||||
* Copyright 2000-2015 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -15,9 +15,7 @@
|
||||
*/
|
||||
package com.intellij.testFramework.vcs;
|
||||
|
||||
import com.intellij.openapi.vcs.FilePath;
|
||||
import com.intellij.openapi.vcs.FileStatus;
|
||||
import com.intellij.openapi.vcs.changes.Change;
|
||||
import com.intellij.openapi.vcs.changes.ChangeListManager;
|
||||
import com.intellij.openapi.vcs.changes.ChangeListManagerGate;
|
||||
import com.intellij.openapi.vcs.changes.LocalChangeList;
|
||||
@@ -35,18 +33,22 @@ public class MockChangeListManagerGate implements ChangeListManagerGate {
|
||||
myManager = manager;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<LocalChangeList> getListsCopy() {
|
||||
return myManager.getChangeListsCopy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public LocalChangeList findChangeList(final String name) {
|
||||
return myManager.findChangeList(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LocalChangeList addChangeList(final String name, final String comment) {
|
||||
return myManager.addChangeList(name, comment);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LocalChangeList findOrCreateList(final String name, final String comment) {
|
||||
LocalChangeList changeList = myManager.findChangeList(name);
|
||||
if (changeList == null) {
|
||||
@@ -55,23 +57,18 @@ public class MockChangeListManagerGate implements ChangeListManagerGate {
|
||||
return changeList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void editComment(final String name, final String comment) {
|
||||
myManager.editComment(name, comment);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void editName(String oldName, String newName) {
|
||||
myManager.editName(oldName, newName);
|
||||
}
|
||||
|
||||
public void moveChanges(String toList, Collection<Change> changes) {
|
||||
final LocalChangeList changeList = myManager.findChangeList(toList);
|
||||
if (changeList != null) {
|
||||
myManager.moveChangesTo(changeList, changes.toArray(new Change[changes.size()]));
|
||||
}
|
||||
}
|
||||
|
||||
public void setListsToDisappear(Collection<String> names) {
|
||||
}
|
||||
@Override
|
||||
public void setListsToDisappear(Collection<String> names) { }
|
||||
|
||||
@Override
|
||||
public FileStatus getStatus(VirtualFile file) {
|
||||
@@ -84,6 +81,5 @@ public class MockChangeListManagerGate implements ChangeListManagerGate {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDefaultChangeList(@NotNull String list) {
|
||||
}
|
||||
public void setDefaultChangeList(@NotNull String list) { }
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2009 JetBrains s.r.o.
|
||||
* Copyright 2000-2015 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -39,12 +39,6 @@ public interface ChangeListManagerGate {
|
||||
void editComment(final String name, final String comment);
|
||||
void editName(final String oldName, final String newName);
|
||||
|
||||
|
||||
/**
|
||||
* @deprecated unused, to be removed in IDEA 15
|
||||
*/
|
||||
void moveChanges(final String toList, final Collection<Change> changes);
|
||||
|
||||
void setListsToDisappear(final Collection<String> names);
|
||||
FileStatus getStatus(final VirtualFile file);
|
||||
FileStatus getStatus(final File file);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
* Copyright 2000-2015 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -737,19 +737,23 @@ public class ChangeListWorker implements ChangeListsWriteOperations {
|
||||
myWorker = worker;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<LocalChangeList> getListsCopy() {
|
||||
return myWorker.getListsCopy();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public LocalChangeList findChangeList(final String name) {
|
||||
return myWorker.getCopyByName(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LocalChangeList addChangeList(final String name, final String comment) {
|
||||
return myWorker.addChangeList(null, name, comment, true, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LocalChangeList findOrCreateList(final String name, final String comment) {
|
||||
LocalChangeList list = myWorker.getCopyByName(name);
|
||||
if (list == null) {
|
||||
@@ -758,19 +762,17 @@ public class ChangeListWorker implements ChangeListsWriteOperations {
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void editComment(final String name, final String comment) {
|
||||
myWorker.editComment(name, comment);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void editName(String oldName, String newName) {
|
||||
myWorker.editName(oldName, newName);
|
||||
}
|
||||
|
||||
// todo usage allowed only when..
|
||||
public void moveChanges(String toList, Collection<Change> changes) {
|
||||
myWorker.moveChangesTo(toList, changes.toArray(new Change[changes.size()]));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setListsToDisappear(final Collection<String> names) {
|
||||
myWorker.setListsToDisappear(names);
|
||||
}
|
||||
@@ -795,16 +797,15 @@ public class ChangeListWorker implements ChangeListsWriteOperations {
|
||||
myIdx.remove(path);
|
||||
|
||||
for (LocalChangeList list : myMap.values()) {
|
||||
for (Iterator<Change> iterator = list.getChanges().iterator(); iterator.hasNext(); ) {
|
||||
final Change change = iterator.next();
|
||||
for (Change change : list.getChanges()) {
|
||||
final ContentRevision afterRevision = change.getAfterRevision();
|
||||
if (afterRevision != null && afterRevision.getFile().equals(path)) {
|
||||
((LocalChangeListImpl) list).removeChange(change);
|
||||
((LocalChangeListImpl)list).removeChange(change);
|
||||
return;
|
||||
}
|
||||
final ContentRevision beforeRevision = change.getBeforeRevision();
|
||||
if (beforeRevision != null && beforeRevision.getFile().equals(path)) {
|
||||
((LocalChangeListImpl) list).removeChange(change);
|
||||
((LocalChangeListImpl)list).removeChange(change);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user