commit 2e23f0d59ca934e8e13046f6ee91aa1a54261c81
Author: Dustin J. Mitchell <dustin@zmanda.com>
Date:   Sat Jul 9 18:38:30 2011 -0500

    tests

diff --git a/twisted/persisted/styles.py b/twisted/persisted/styles.py
index bf89467..fb85cd9 100644
--- a/twisted/persisted/styles.py
+++ b/twisted/persisted/styles.py
@@ -12,6 +12,7 @@ Different styles of persisted objects.
 import types
 import copy_reg
 import copy
+import inspect
 
 try:
     import cStringIO as StringIO
@@ -20,6 +21,7 @@ except ImportError:
 
 # Twisted Imports
 from twisted.python import log
+from twisted.python import reflect
 
 oldModules = {}
 
@@ -143,14 +145,25 @@ def requireUpgrade(obj):
         obj.versionUpgrade()
         return obj
 
-from twisted.python import reflect
-
 def _aybabtu(c):
-    l = []
-    for b in reflect.allYourBase(c, Versioned):
-        if b not in l and b is not Versioned:
+    """
+    Get all of the parent classes of C{c}, not including C{c} itself, which are
+    strict subclasses of L{Versioned}.
+
+    The name comes from "all your base are belong to us", from the deprecated
+    L{twisted.python.reflect.allYourBase} function.
+
+    @param c: a class
+    @returns: list of classes
+    """
+    # begin with two classes that should *not* be included in the
+    # final result
+    l = [ c, Versioned ]
+    for b in inspect.getmro(c):
+        if b not in l and issubclass(b, Versioned):
             l.append(b)
-    return l
+    # return all except the unwanted classes
+    return l[2:]
 
 class Versioned:
     """
diff --git a/twisted/test/test_persisted.py b/twisted/test/test_persisted.py
index ff1912a..b7a93a0 100644
--- a/twisted/test/test_persisted.py
+++ b/twisted/test/test_persisted.py
@@ -112,6 +112,43 @@ class VersionTestCase(unittest.TestCase):
         styles.doUpgrade()
         self.failUnless(x.y.upgraded)
 
+
+
+class VersionedSubClass(styles.Versioned):
+    pass
+
+
+
+class SecondVersionedSubClass(styles.Versioned):
+    pass
+
+
+
+class VersionedSubSubClass(VersionedSubClass):
+    pass
+
+
+
+class VersionedDiamondSubClass(VersionedSubSubClass, SecondVersionedSubClass):
+    pass
+
+
+
+class AybabtuTests(unittest.TestCase):
+
+
+    def testAybabtu(self):
+        """
+        Test styles._aybabtu, including edge cases.
+        """
+        self.assertEqual(styles._aybabtu(styles.Versioned), [])
+        self.assertEqual(styles._aybabtu(VersionedSubClass), [])
+        self.assertEqual(styles._aybabtu(VersionedSubSubClass),
+            [VersionedSubClass])
+        self.assertEqual(styles._aybabtu(VersionedDiamondSubClass),
+            [VersionedSubSubClass, VersionedSubClass, SecondVersionedSubClass])
+
+
 class MyEphemeral(styles.Ephemeral):
 
     def __init__(self, x):
diff --git a/twisted/topfiles/5193.bugfix b/twisted/topfiles/5193.bugfix
new file mode 100644
index 0000000..5c69933
--- /dev/null
+++ b/twisted/topfiles/5193.bugfix
@@ -0,0 +1 @@
+twisted.persisted.styles no longer uses the deprecated allYourBase function
