public synchronized void updateFrom(ManagedBufferFile versionedBufferFile, int oldVersion,
			TaskMonitor monitor) throws IOException, CancelledException {

		if (!canSave()) {
			throw new IOException("File does not allow update");
		}
		if (bfMgr == null) {
			throw new UnsupportedOperationException(
				"Buffer file is not associated with BufferFileManager");
		}

		// Create combined change map so that every buffer modified locally since checkout
		// or within the versionedBufferFile since checkout gets copied from versionedBufferFile.
		byte[] versionedChanges = versionedBufferFile.getForwardModMapData(oldVersion);
		ChangeMap newChangeMap = new ChangeMap(versionedChanges);
		byte[] myModifiedBuffers = getForwardModMapData();
		if (myModifiedBuffers != null) {
			newChangeMap.addChangeMapData(myModifiedBuffers);
		}
		newChangeMap.setChangedIndexes(getFreeIndexes());
		newChangeMap.setUnchangedIndexes(versionedBufferFile.getFreeIndexes());

		LocalManagedBufferFile bf = getSaveFile(monitor);
		boolean success = false;
		try {

			copyFile(versionedBufferFile, bf, newChangeMap, monitor);

			// Merged file may be smaller - truncate if necessary
			int indexCount = versionedBufferFile.getIndexCount();
			if (indexCount < bf.getIndexCount()) {
				bf.truncate(indexCount);
			}
			success = true;
		}
		finally {
			saveCompleted(success);
			if (!success) {
				bfMgr.updateEnded(checkinId);
			}
//			else {
//				// VERIFY RESULT FILE
//				System.err.println("Update check: " + file);
//				checkSameContent(versionedBufferFile, bf);
//			}
		}

	}
Create a new version of this file by updating it from a versionedBufferFile.  
This file must be open as read-only with versionUpdateEnabled and have been derived 
from an oldVersion of the versionedBufferFile (i.e., was based on a check-out of oldVersion).
The save-file corresponding to this file is updated using those buffers
which have been modified or added in the specified versionedBufferFile 
since olderVersion.  When complete, this file should be closed
as soon as possible.
@param versionedBufferFile versioned buffer file
@param oldVersion older version of versionedBufferFile from which this buffer file originated.
@param monitor progress monitor
@throws IOException if an I/O error occurs
@throws CancelledException if monitor cancels operation
Ghidra/Framework/DB/src/main/java/db/buffers/LocalManagedBufferFile.java