mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
diff: LST - remove deprecated logic
myPreviousBaseRevision is always null, as resetForBaseRevisionLoad() is not used anymore
This commit is contained in:
@@ -71,7 +71,6 @@ public class LineStatusTracker {
|
||||
private boolean myBulkUpdate;
|
||||
private final Application myApplication;
|
||||
@Nullable private RevisionPack myBaseRevisionNumber;
|
||||
private String myPreviousBaseRevision;
|
||||
private boolean myAnathemaThrown;
|
||||
private FileEditorManager myFileEditorManager;
|
||||
private final VcsDirtyScopeManager myVcsDirtyScopeManager;
|
||||
@@ -104,7 +103,6 @@ public class LineStatusTracker {
|
||||
if (myBaseRevisionNumber != null && myBaseRevisionNumber.after(baseRevisionNumber)) return;
|
||||
|
||||
myBaseRevisionNumber = baseRevisionNumber;
|
||||
myPreviousBaseRevision = null;
|
||||
|
||||
myVcsDocument.setReadOnly(false);
|
||||
myVcsDocument.replaceString(0, myVcsDocument.getTextLength(), vcsContent);
|
||||
@@ -122,20 +120,6 @@ public class LineStatusTracker {
|
||||
}
|
||||
}
|
||||
|
||||
public void useCachedBaseRevision(final RevisionPack number) {
|
||||
synchronized (myLock) {
|
||||
assert myBaseRevisionNumber != null;
|
||||
if (myPreviousBaseRevision == null || myBaseRevisionNumber.after(number)) return;
|
||||
initialize(myPreviousBaseRevision, number);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean canUseBaseRevision(final RevisionPack number) {
|
||||
synchronized (myLock) {
|
||||
return myBaseRevisionNumber != null && myBaseRevisionNumber.equals(number) && myPreviousBaseRevision != null;
|
||||
}
|
||||
}
|
||||
|
||||
private void reinstallRanges() {
|
||||
myApplication.assertReadAccessAllowed();
|
||||
|
||||
@@ -273,28 +257,6 @@ public class LineStatusTracker {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return true if was cleared and base revision contents load should be started
|
||||
* false -> load was already started; after contents is loaded,
|
||||
*/
|
||||
public void resetForBaseRevisionLoad() {
|
||||
myApplication.assertReadAccessAllowed();
|
||||
|
||||
synchronized (myLock) {
|
||||
// there can be multiple resets before init -> take from document only firts time -> when right after install(),
|
||||
// where myPreviousBaseRevision become null
|
||||
if (BaseLoadState.LOADED.equals(myBaseLoaded) && myPreviousBaseRevision == null) {
|
||||
myPreviousBaseRevision = myVcsDocument.getText();
|
||||
}
|
||||
myVcsDocument.setReadOnly(false);
|
||||
myVcsDocument.setText("");
|
||||
myVcsDocument.setReadOnly(true);
|
||||
removeAnathema();
|
||||
removeHighlightersFromMarkupModel();
|
||||
myBaseLoaded = BaseLoadState.LOADING;
|
||||
}
|
||||
}
|
||||
|
||||
private void markFileUnchanged() {
|
||||
ApplicationManager.getApplication().invokeLater(new Runnable() {
|
||||
@Override
|
||||
|
||||
@@ -311,20 +311,6 @@ public class LineStatusTrackerManager implements ProjectComponent, LineStatusTra
|
||||
final LineStatusTracker.RevisionPack revisionPack = new LineStatusTracker.RevisionPack(myLoadCounter, baseRevision);
|
||||
++ myLoadCounter;
|
||||
|
||||
synchronized (myLock) {
|
||||
final LineStatusTracker tracker = myLineStatusTrackers.get(myDocument);
|
||||
if (tracker != null && tracker.canUseBaseRevision(revisionPack)) {
|
||||
nonModalAliveInvokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
log("installTracker() for file " + myVirtualFile.getPath() + " base revision number already in tracker");
|
||||
tracker.useCachedBaseRevision(revisionPack);
|
||||
}
|
||||
});
|
||||
// already ok revision
|
||||
return;
|
||||
}
|
||||
}
|
||||
final String lastUpToDateContent = myStatusProvider.getBaseVersionContent(myVirtualFile);
|
||||
if (lastUpToDateContent == null) {
|
||||
log("installTracker() for file " + myVirtualFile.getPath() + " failed: no up to date content");
|
||||
|
||||
Reference in New Issue
Block a user