[Zope] Version objects and created object bug

J C Lawrence claw@kanga.nu
Wed, 11 Jun 2003 21:54:42 -0700


Version objects seem to have some bugs related to objects created inside
the version (newly created objects, not edited objects).

As a simple example:

  1) Create a folder, "test".

  2) Create a version object in the folder.

  3) Join/open the version.

  4) Create two DTML documents in the root of the site, "test_aq".  Note
  that it is controlled by the version (see the red star in the ZMI).
  Why?  Shouldn't version objects apply only to their current folder and
  things under them, or are they really just named change sets for the
  entire Zope tree?  Version objects ignore acquisition?

  5) Create two DTML documents in "test", "unchanged" and "changed".

  6) Make a simple edit to "changed" and save it.

  7) Commit/save the version (you can quit the version first or not).

  8) Quit the version if you haven't already.

  9) View the "test" folder.  Note that "changed" and "unchanged" are
  not visible outside of the version.  (They should be!)

  10) Join the version and note that "changed" and "unchanged" are still
  flagged as controlled by the version.

What gives?

In trying to dig thru this I ran into FileStorage:versionEmpty() (its in
the call tree under the DTML that decides if there are things to commit
in a version).  I've been beating on that code for a few hours now and
just don't grok it.  Just what is the following condition testing for?

                if index[oid]==srcpos: return 0

  Line 1384 for Zope 2.6.1.

Or more simply, I don't understand what the following leading comment
actually means:

  #   When committing or aborting, we search backward through the linked
  #   list until we find a record for an object that does not have a
  #   current record in the version.  If we find a record for which the
  #   non-version pointer is the same as the previous pointer, then we
  #   forget that the corresponding object had a current record in the
  #   version. This strategy allows us to avoid searching backward
  #   through previously committed or aborted version records.

That comment would seem to suggest that the above conditional should be
"!="?

Ideas, help?

--
J C Lawrence
---------(*)                Satan, oscillate my metallic sonatas.
claw@kanga.nu               He lived as a devil, eh?
http://www.kanga.nu/~claw/  Evil is a name of a foeman, as I live.