• Barry Warsaw's avatar
    InternalInconsistencyError => POSException.StorageSystemError · bc1f63a1
    Barry Warsaw authored
    _finish(): In delete-a-version clause, use next_dup() instead of
    next() to iterate over the currentVersions table with cursor set to
    the vid of the version we're deleting.
    
    abortVersion(): When cruising over the currentVersions table (and the
    key set to vid of the version we're aborting), use next_dup() instead
    of next().  Also, when curvid <> vid, raise StorageSystemError instead
    of VersionError.  Same later on when we check curvid <> zero.
    
    commitVersion(): Add sanity checking based on model documentation: if
    the source version is the empty string, or src == dest, raise a
    VersionCommitError.  Make the same changes we made previously to
    abortVersion() to keep track of the oids in a set/dictionary instead
    of a list to avoid duplicates.  Other fixes include, writing revid
    instead of tid==self._serial to write_moved_object() and adding a
    write_discard_version(svid) once the source version's been committed.
    
    commitVersion() now works!
    
    load(): Add another check to avoid finding an object revision in a
    committed or aborted version if we can guess that version name.  It
    now raises a VersionError if vid==zero and version is true.
    
    Also, although we still raise VersionError later on, elaborate the
    actual exception better in the error message.
    bc1f63a1
Full.py 40.2 KB