[Zodb-checkins] SVN: ZODB/branches/3.5/ Fix for Collector #1810: A
previous bugfix (#1726) broke listing undoable
Martijn Pieters
mj at zopatista.com
Sun Sep 25 18:27:59 EDT 2005
Log message for revision 38634:
Fix for Collector #1810: A previous bugfix (#1726) broke listing undoable
transactions for users defined in a non-root acl_users folder. Zope logs a
acl_users path together with a username (separated by a space) and this
previous fix failed to take this into account. Fixed by taking anything after
the last space in the compared path out of the equation.
Changed:
U ZODB/branches/3.5/NEWS.txt
U ZODB/branches/3.5/src/ZopeUndo/Prefix.py
U ZODB/branches/3.5/src/ZopeUndo/tests/testPrefix.py
-=-
Modified: ZODB/branches/3.5/NEWS.txt
===================================================================
--- ZODB/branches/3.5/NEWS.txt 2005-09-25 22:27:53 UTC (rev 38633)
+++ ZODB/branches/3.5/NEWS.txt 2005-09-25 22:27:59 UTC (rev 38634)
@@ -19,7 +19,15 @@
has a script that expects to import it from there. ZODB's ``mkzeoinst``
script was rewritten to invoke the ``mkzeoinst`` module.
+ZopeUndo
+--------
+- (3.5.1b3) Collector 1810. A previous bugfix (#1726) broke listing undoable
+ transactions for users defined in a non-root acl_users folder. Zope logs
+ a acl_users path together with a username (separated by a space) and this
+ previous fix failed to take this into account.
+
+
What's new in ZODB3 3.5.0?
==========================
Release date: 31-Aug-2005
Modified: ZODB/branches/3.5/src/ZopeUndo/Prefix.py
===================================================================
--- ZODB/branches/3.5/src/ZopeUndo/Prefix.py 2005-09-25 22:27:53 UTC (rev 38633)
+++ ZODB/branches/3.5/src/ZopeUndo/Prefix.py 2005-09-25 22:27:59 UTC (rev 38634)
@@ -39,6 +39,10 @@
def __cmp__(self, o):
other_path = o.split('/')
+ if other_path and ' ' in other_path[-1]:
+ # don't include logged username in comparison
+ pos = other_path[-1].rfind(' ')
+ other_path[-1] = other_path[-1][:pos]
return cmp(other_path[:self.length], self.path)
def __repr__(self):
Modified: ZODB/branches/3.5/src/ZopeUndo/tests/testPrefix.py
===================================================================
--- ZODB/branches/3.5/src/ZopeUndo/tests/testPrefix.py 2005-09-25 22:27:53 UTC (rev 38633)
+++ ZODB/branches/3.5/src/ZopeUndo/tests/testPrefix.py 2005-09-25 22:27:59 UTC (rev 38634)
@@ -28,5 +28,19 @@
for equal in ("", "/", "/def", "/a/b", "/a/b/c", "/a/b/c/d"):
self.assertEqual(p2, equal)
+ def test_username_info(self):
+ # Zope Collector 1810; user paths have username appended
+ p1 = Prefix('/a/b')
+ for equal in ('/a/b spam', '/a/b/c spam', '/a/b/c/b spam'):
+ self.assertEqual(p1, equal)
+ for notEqual in (" spam", "/a/c spam", "/a/bbb spam", "/// spam"):
+ self.assertNotEqual(p1, notEqual)
+
+ p2 = Prefix("")
+ for equal in (" eggs", "/ eggs", "/def eggs", "/a/b eggs",
+ "/a/b/c eggs", "/a/b/c/d eggs"):
+ self.assertEqual(p2, equal)
+
+
def test_suite():
return unittest.makeSuite(PrefixTest)
More information about the Zodb-checkins
mailing list