Re: [Zope-dev] Odd behavior of undoable_transactions()
Paul Winkler [EMAIL PROTECTED] wrote: On Sun, Mar 13, 2005 at 06:57:28PM +0100, Florent Guillaume wrote: You're right. Please put it in the collector. The prefixes should indeed be matching only at '/' boundaries. OK, issue created at http://www.zope.org/Collectors/Zope/1726 and assigned to myself. If nobody objects soon, I will check in tests fixes on both the 2_7 CVS branch and on the SVN trunk. (Is there a 2_8 branch in SVN too? I haven't worked there much yet.) Not yet, but there probably shortly will. Florent -- Florent Guillaume, Nuxeo (Paris, France) CTO, Director of RD +33 1 40 33 71 59 http://nuxeo.com [EMAIL PROTECTED] ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Odd behavior of undoable_transactions()
On Sun, Mar 13, 2005 at 06:57:28PM +0100, Florent Guillaume wrote: You're right. Please put it in the collector. The prefixes should indeed be matching only at '/' boundaries. OK, issue created at http://www.zope.org/Collectors/Zope/1726 and assigned to myself. If nobody objects soon, I will check in tests fixes on both the 2_7 CVS branch and on the SVN trunk. (Is there a 2_8 branch in SVN too? I haven't worked there much yet.) -- Paul Winkler http://www.slinkp.com ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Odd behavior of undoable_transactions()
You're right. Please put it in the collector. The prefixes should indeed be matching only at '/' boundaries. Florent Paul Winkler [EMAIL PROTECTED] wrote: Is anyone but me bothered by this behavior of undoable_transactions()? If I have a folder /foo and another folder /foobar, transactions for /foobar are displayed in foo.undoable_transactions(). This is clearly caused by lib/python/ZopeUndo/Prefix.py. The behavior matches the docstring - Prefix only cares if one string starts with the other, nothing more. But is that really desirable? Since this is intended purely for use in Zope, wouldn't it be more useful if it cared about paths as such? Something like (untested): class PathPrefix: A PathPrefix() is equal to any path string it is a prefix of. Two prefixes can not be compared. __no_side_effects__ = 1 # what's this mean anyway? def __init__(self, path): path_as_list = path.split('/') self.length = len(path_as_list) self.path = path_as_list def __cmp__(self, o): other_path = o.split('/') rval = cmp(other[:self.length], self.path) return rval -- Florent Guillaume, Nuxeo (Paris, France) CTO, Director of RD +33 1 40 33 71 59 http://nuxeo.com [EMAIL PROTECTED] ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )