mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
only remember the unchanged content of which we are sure it's unchanged: the file is not queued for vcs update
This commit is contained in:
@@ -449,6 +449,17 @@ public class ChangeListManagerImpl extends ChangeListManagerEx implements Projec
|
||||
}
|
||||
});
|
||||
|
||||
for (VcsDirtyScope scope : scopes) {
|
||||
scope.iterateExistingInsideScope(new Processor<VirtualFile>() {
|
||||
@Override
|
||||
public boolean process(VirtualFile file) {
|
||||
file.putUserData(LastUnchangedContentTracker.VCS_INVALID_FILE_STATUS, null); //todo what if it has become dirty again during update?
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
myChangesViewManager.scheduleRefresh();
|
||||
}
|
||||
catch (DisposedException e) {
|
||||
|
||||
+6
@@ -37,8 +37,13 @@ public class LastUnchangedContentTracker {
|
||||
private static final Key<Long> LAST_TS_KEY = Key.create("LAST_TS_KEY");
|
||||
private static final FileAttribute LAST_TS_ATTR = new FileAttribute("LAST_TS_ATTR", 0, true);
|
||||
private static final FileAttribute ACQUIRED_CONTENT_ATTR = new FileAttribute("ACQUIRED_CONTENT_ATTR", 1, true);
|
||||
public static final Key<Boolean> VCS_INVALID_FILE_STATUS = Key.create("VCS_INVALID_FILE_STATUS");
|
||||
|
||||
public static void updateLastUnchangedContent(@NotNull VirtualFile file) {
|
||||
if (Boolean.TRUE.equals(file.getUserData(VCS_INVALID_FILE_STATUS))) {
|
||||
return;
|
||||
}
|
||||
|
||||
Long lastTs = getLastSavedStamp(file);
|
||||
final long stamp = file.getModificationStamp();
|
||||
if (lastTs != null && stamp == lastTs) {
|
||||
@@ -51,6 +56,7 @@ public class LastUnchangedContentTracker {
|
||||
}
|
||||
|
||||
saveContentReference(file, getFS().acquireContent(file));
|
||||
file.putUserData(VCS_INVALID_FILE_STATUS, Boolean.TRUE);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
||||
Reference in New Issue
Block a user