mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
vcs: simplify ChangeListWorker
This commit is contained in:
committed by
Aleksey Pivovarov
parent
747411891a
commit
9104505f3e
@@ -234,17 +234,15 @@ public class ChangeListWorker implements ChangeListsWriteOperations {
|
||||
LOG.debug("[addChangeToCorrespondingList] for change " + path + " type: " + change.getType() + " have before revision: " + (change.getBeforeRevision() != null));
|
||||
assert myDefault != null;
|
||||
for (LocalChangeListImpl list : myMap.values()) {
|
||||
if (list.isDefault()) {
|
||||
LOG.debug("[addChangeToCorrespondingList] skip default list: " + list.getName() + " type: " + change.getType() + " have before revision: " + (change.getBeforeRevision() != null));
|
||||
continue;
|
||||
}
|
||||
if (list.processChange(change)) {
|
||||
LOG.debug("[addChangeToCorrespondingList] matched: " + list.getName() + " type: " + change.getType() + " have before revision: " + (change.getBeforeRevision() != null));
|
||||
if (list.hadChangeBeforeUpdate(change)) {
|
||||
LOG.debug("[addChangeToCorrespondingList] matched: " + list.getName());
|
||||
list.addChange(change);
|
||||
myIdx.changeAdded(change, vcsKey);
|
||||
return;
|
||||
}
|
||||
}
|
||||
myDefault.processChange(change);
|
||||
LOG.debug("[addChangeToCorrespondingList] added to default list");
|
||||
myDefault.addChange(change);
|
||||
myIdx.changeAdded(change, vcsKey);
|
||||
}
|
||||
|
||||
|
||||
@@ -195,22 +195,8 @@ public class LocalChangeListImpl extends LocalChangeList {
|
||||
});
|
||||
}
|
||||
|
||||
boolean processChange(@NotNull Change change) {
|
||||
LOG.debug("[process change] for '" + myName + "' isDefault: " + myIsDefault + " change: " +
|
||||
ChangesUtil.getFilePath(change).getPath());
|
||||
if (myIsDefault) {
|
||||
LOG.debug("[process change] adding because default");
|
||||
addChange(change);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (myChangesBeforeUpdate.contains(change)) {
|
||||
LOG.debug("[process change] adding because equal to old: " + ChangesUtil.getFilePath(change).getPath());
|
||||
addChange(change);
|
||||
return true;
|
||||
}
|
||||
LOG.debug("[process change] not found");
|
||||
return false;
|
||||
boolean hadChangeBeforeUpdate(@NotNull Change change) {
|
||||
return myChangesBeforeUpdate.contains(change);
|
||||
}
|
||||
|
||||
boolean doneProcessingChanges(final List<Change> removedChanges, final List<Change> addedChanges) {
|
||||
|
||||
Reference in New Issue
Block a user