Commits

Andrew Godwin committed 2af9e6f

Fix the dependency sorting problem lower down. Hopefully this one will be the same on 32-bit.

Comments (0)

Files changed (3)

south/migration/base.py

 
         This list includes `self`, which will be applied last.
         """
-        return depends(self, lambda x: sorted(x.dependencies))
+        return depends(self, lambda x: x.dependencies)
 
     def _backwards_plan(self):
-        return depends(self, lambda x: sorted(x.dependents))
+        return depends(self, lambda x: x.dependents)
 
     def backwards_plan(self):
         """

south/migration/utils.py

             stack.appendleft(x)
         else:
             yield x
+    
 
 def _dfs(start, get_children):
     # Prepend ourselves to the result
     yield start
-    children = get_children(start)
+    children = sorted(get_children(start), key=lambda x: str(x))
     if children:
         # We need to apply all the migrations this one depends on
         yield (_dfs(n, get_children) for n in children)

south/tests/logic.py

                          fakeapp['0003_alter_spam'].forwards_plan())
         
         # And a complex one.
-        self.assertEqual([fakeapp['0001_spam'],
-                          otherfakeapp['0001_first'],
-                          otherfakeapp['0002_second'],
-                          fakeapp['0002_eggs'],
-                          fakeapp['0003_alter_spam'],
-                          otherfakeapp['0003_third']],
-                         otherfakeapp['0003_third'].forwards_plan())
+        self.assertEqual(
+            [
+                fakeapp['0001_spam'],
+                otherfakeapp['0001_first'],
+                otherfakeapp['0002_second'],
+                fakeapp['0002_eggs'],
+                fakeapp['0003_alter_spam'],
+                otherfakeapp['0003_third']
+            ],
+            otherfakeapp['0003_third'].forwards_plan(),
+        )
 
 
 class TestMigrationUtils(Monkeypatcher):
                  'B2': ['B1', 'A2'],
                  'B3': ['B2']}
         self.assertCircularDependency(
-            ['B1', 'A2', 'A1', 'B2', 'B1'],
+            ['A2', 'A1', 'B2', 'A2'],
             'A3',
             graph,
         )
                  'B2': ['B1', 'A2'],
                  'B3': ['B2']}
         self.assertCircularDependency(
-            ['B3', 'B2', 'B1', 'A2', 'A1', 'B3'],
+            ['B2', 'A2', 'A1', 'B3', 'B2'],
             'A3',
             graph,
         )
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.