diff mercurial/upgrade_utils/actions.py @ 49377:7fe86498e84f stable

repo-upgrade: avoid a crash when multiple optimisation are specified In Python 3, the type are no longer comparable and this expose the error.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 05 Jul 2022 17:53:26 +0200
parents 566066826e7c
children d12446766a35
line wrap: on
line diff
--- a/mercurial/upgrade_utils/actions.py	Wed May 25 18:29:21 2022 +0200
+++ b/mercurial/upgrade_utils/actions.py	Tue Jul 05 17:53:26 2022 +0200
@@ -683,7 +683,11 @@
 
         newactions.append(d)
 
-    newactions.extend(o for o in sorted(optimizations) if o not in newactions)
+    newactions.extend(
+        o
+        for o in sorted(optimizations, key=(lambda x: x.name))
+        if o not in newactions
+    )
 
     # FUTURE consider adding some optimizations here for certain transitions.
     # e.g. adding generaldelta could schedule parent redeltas.