Commit 904f8975 authored by Barry Warsaw's avatar Barry Warsaw

checkHistoryAfterVersionCommit(), checkHistoryAfterVersionAbort():

After consultation with Jim, we agreed that Full's behavior vis object
serial numbers after a version commit/abort are correct.  The new
revision should get the serial number of the transaction that did the
commit/abort.

FileStorage is actually broken here; the new revision gets the same
serial number as the last in-version revision.  However, the way the
tests are written, it works for either storage, so I'm just updating
some comments to explain the situation.

Note: Jim also explained that history()'s "version" argument should be
ignored.  Doesn't make much difference to these tests though.
parent 733f67ed
......@@ -94,10 +94,16 @@ class HistoryStorage:
oids = self._storage.commitVersion(version, '', self._transaction)
self._storage.tpc_vote(self._transaction)
self._storage.tpc_finish(self._transaction)
# It is not guaranteed that the revision id (a.k.a. serial number) for
# the version-committed object is the same as the last in-version
# modification. We need to suck that out of the API a different way,
# just to be sure.
# After consultation with Jim, we agreed that the semantics of
# revision id's after a version commit is that the committed object
# gets a new serial number (a.k.a. revision id). Note that
# FileStorage is broken here; the serial number in the post-commit
# non-version revision will be the same as the serial number of the
# previous in-version revision.
#
# BAW: Using load() is the only way to get the serial number of the
# current revision of the object. But at least this works for both
# broken and working storages.
ign, revid7 = self._storage.load(oid, '')
# Now, try to get the six historical revisions (first three are in
# 'test-version', followed by the non-version revisions).
......@@ -137,10 +143,16 @@ class HistoryStorage:
oids = self._storage.abortVersion(version, self._transaction)
self._storage.tpc_vote(self._transaction)
self._storage.tpc_finish(self._transaction)
# It is not guaranteed that the revision id (a.k.a. serial number) for
# the version-committed object is the same as the last in-version
# modification. We need to suck that out of the API a different way,
# just to be sure.
# After consultation with Jim, we agreed that the semantics of
# revision id's after a version commit is that the committed object
# gets a new serial number (a.k.a. revision id). Note that
# FileStorage is broken here; the serial number in the post-commit
# non-version revision will be the same as the serial number of the
# previous in-version revision.
#
# BAW: Using load() is the only way to get the serial number of the
# current revision of the object. But at least this works for both
# broken and working storages.
ign, revid7 = self._storage.load(oid, '')
# Now, try to get the six historical revisions (first three are in
# 'test-version', followed by the non-version revisions).
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment