diff --git a/mercurial/upgrade_utils/actions.py b/mercurial/upgrade_utils/actions.py --- a/mercurial/upgrade_utils/actions.py +++ b/mercurial/upgrade_utils/actions.py @@ -683,7 +683,11 @@ def determine_upgrade_actions( 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. diff --git a/tests/test-upgrade-repo.t b/tests/test-upgrade-repo.t --- a/tests/test-upgrade-repo.t +++ b/tests/test-upgrade-repo.t @@ -467,6 +467,7 @@ modern form of the option re-delta-fulladd every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved. + $ hg debugupgrade --optimize re-delta-parent --quiet requirements preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !) @@ -480,6 +481,20 @@ modern form of the option - manifest +passing multiple optimization: + + $ hg debugupgrade --optimize re-delta-parent --optimize re-delta-multibase --quiet + requirements + preserved: * (glob) + + optimisations: re-delta-multibase, re-delta-parent + + processed revlogs: + - all-filelogs + - changelog + - manifest + + unknown optimization: $ hg debugupgrade --optimize foobar