Ticket #1068 (closed defect: fixed)
Build history pickles are perpetually re-upgraded
|Reported by:||exarkun||Owned by:|
Whenever an out of date build history pickle is loaded, if it isn't the latest version, it is upgraded. Unfortunately, if nothing about the state is changed (as is frequently the case), the upgraded version is discarded and the upgrade is re-done the next time that pickle is loaded.
Instead, if the state is upgraded, the pickle should be re-written with the upgraded state. This can be done by marking upgraded objects using a simple flag, set to True by any upgradeToVersionN method, and then checked after styles.doUpgrade is called. If and only if the flag is set, the object was upgraded and should be rewritten. Additionally, adding the flag to the persistenceForgets tuple on the Versioned subclass will cause it to be discarded when the object is re-serialized.