mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2024-11-10 06:02:09 +00:00
Merge remote-tracking branch 'origin/GP-4921_ghidragon_fixing_check-in_change_markers--SQUASHED' into Ghidra_11.2
This commit is contained in:
commit
dcb12afb8b
@ -279,7 +279,7 @@ public class MyProgramChangesDisplayPlugin extends ProgramPlugin implements Doma
|
||||
}
|
||||
|
||||
if (isTrackingServerChanges()) {
|
||||
if (programSaved) {
|
||||
if (programSaved || programChangedRemotely) {
|
||||
currentChangesSinceCheckoutMarks
|
||||
.setAddressSetCollection(changeSet.getAddressSetCollectionSinceCheckout());
|
||||
}
|
||||
|
@ -78,7 +78,7 @@ public class ProgramContentHandler extends DBWithUserDataContentHandler<ProgramD
|
||||
bf = dbItem.open(version, minChangeVersion);
|
||||
dbh = new DBHandle(bf);
|
||||
program = new ProgramDB(dbh, OpenMode.IMMUTABLE, monitor, consumer);
|
||||
getProgramChangeSet(program, bf);
|
||||
loadProgramChangeSet(program, bf);
|
||||
success = true;
|
||||
return program;
|
||||
}
|
||||
@ -130,7 +130,7 @@ public class ProgramContentHandler extends DBWithUserDataContentHandler<ProgramD
|
||||
dbh = new DBHandle(bf);
|
||||
OpenMode openMode = okToUpgrade ? OpenMode.UPGRADE : OpenMode.UPDATE;
|
||||
program = new ProgramDB(dbh, openMode, monitor, consumer);
|
||||
getProgramChangeSet(program, bf);
|
||||
loadProgramChangeSet(program, bf);
|
||||
program.setProgramUserData(new ProgramUserDataDB(program));
|
||||
success = true;
|
||||
return program;
|
||||
@ -184,7 +184,7 @@ public class ProgramContentHandler extends DBWithUserDataContentHandler<ProgramD
|
||||
OpenMode openMode = okToUpgrade ? OpenMode.UPGRADE : OpenMode.UPDATE;
|
||||
program = new ProgramDB(dbh, openMode, monitor, consumer);
|
||||
if (checkoutId == FolderItem.DEFAULT_CHECKOUT_ID) {
|
||||
getProgramChangeSet(program, bf);
|
||||
loadProgramChangeSet(program, bf);
|
||||
}
|
||||
if (recover) {
|
||||
recoverChangeSet(program, dbh);
|
||||
@ -255,9 +255,11 @@ public class ProgramContentHandler extends DBWithUserDataContentHandler<ProgramD
|
||||
}
|
||||
}
|
||||
|
||||
private ProgramDBChangeSet getProgramChangeSet(ProgramDB program, ManagedBufferFile bf)
|
||||
private ProgramDBChangeSet loadProgramChangeSet(ProgramDB program, ManagedBufferFile bf)
|
||||
throws IOException {
|
||||
ProgramDBChangeSet changeSet = (ProgramDBChangeSet) program.getChangeSet();
|
||||
changeSet.clearAll();
|
||||
|
||||
BufferFile cf = bf.getNextChangeDataFile(true);
|
||||
DBHandle cfh = null;
|
||||
while (cf != null) {
|
||||
@ -292,7 +294,7 @@ public class ProgramContentHandler extends DBWithUserDataContentHandler<ProgramD
|
||||
bf = dbItem.open(toVer, fromVer);
|
||||
dbh = new DBHandle(bf);
|
||||
program = new ProgramDB(dbh, OpenMode.IMMUTABLE, null, this);
|
||||
return getProgramChangeSet(program, bf);
|
||||
return loadProgramChangeSet(program, bf);
|
||||
}
|
||||
catch (VersionException | IOException e) {
|
||||
throw e;
|
||||
@ -374,7 +376,7 @@ public class ProgramContentHandler extends DBWithUserDataContentHandler<ProgramD
|
||||
}
|
||||
LocalManagedBufferFile bf = dbItem.openForUpdate(FolderItem.DEFAULT_CHECKOUT_ID);
|
||||
program.getDBHandle().setDBVersionedSourceFile(bf);
|
||||
getProgramChangeSet(program, bf);
|
||||
loadProgramChangeSet(program, bf);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -361,25 +361,29 @@ class ProgramDBChangeSet implements ProgramChangeSet, DomainObjectDBChangeSet {
|
||||
}
|
||||
|
||||
if (!isCheckedOut) { // if not versioned, wipe out change sets
|
||||
changedAddrsSinceCheckout.clear();
|
||||
changedRegAddrsSinceCheckout.clear();
|
||||
changedAddrsSinceSave.clear();
|
||||
changedRegAddrsSinceSave.clear();
|
||||
changedCategoryIds.clear();
|
||||
changedDataTypeIds.clear();
|
||||
changedProgramTreeIds.clear();
|
||||
changedSymbolIds.clear();
|
||||
changedSourceArchiveIds.clear();
|
||||
addedCategoryIds.clear();
|
||||
addedDataTypeIds.clear();
|
||||
addedProgramTreeIds.clear();
|
||||
addedSymbolIds.clear();
|
||||
addedSourceArchiveIds.clear();
|
||||
clearAll();
|
||||
}
|
||||
|
||||
clearUndo();
|
||||
}
|
||||
|
||||
void clearAll() {
|
||||
changedAddrsSinceCheckout.clear();
|
||||
changedRegAddrsSinceCheckout.clear();
|
||||
changedAddrsSinceSave.clear();
|
||||
changedRegAddrsSinceSave.clear();
|
||||
changedCategoryIds.clear();
|
||||
changedDataTypeIds.clear();
|
||||
changedProgramTreeIds.clear();
|
||||
changedSymbolIds.clear();
|
||||
changedSourceArchiveIds.clear();
|
||||
addedCategoryIds.clear();
|
||||
addedDataTypeIds.clear();
|
||||
addedProgramTreeIds.clear();
|
||||
addedSymbolIds.clear();
|
||||
addedSourceArchiveIds.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void startTransaction() {
|
||||
inTransaction = true;
|
||||
@ -659,6 +663,7 @@ class ProgramDBChangeSet implements ProgramChangeSet, DomainObjectDBChangeSet {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class ChangeDiff {
|
||||
|
Loading…
Reference in New Issue
Block a user