obsutil: sort metadata before comparing in geteffectflag() stable
authorAnton Shestakov <av6@dwimlabs.net>
Wed, 13 Mar 2024 16:22:13 -0300
branchstable
changeset 51502 a5d8f261b716
parent 51501 e5b28637f4ca
child 51503 d4095f7b000a
obsutil: sort metadata before comparing in geteffectflag() This is probably less important now that we dropped Python 2. We do still support Python 3.6 though, and the dictionaries aren't ordered there either (that was a big change that came with 3.7). Still, maybe it's a good idea to sort metadata explicitly.
mercurial/obsutil.py
--- a/mercurial/obsutil.py	Mon Mar 11 11:11:34 2024 +0100
+++ b/mercurial/obsutil.py	Wed Mar 13 16:22:13 2024 -0300
@@ -468,10 +468,10 @@
 
         # Check if other meta has changed
         changeextra = changectx.extra().items()
-        ctxmeta = list(filter(metanotblacklisted, changeextra))
+        ctxmeta = sorted(filter(metanotblacklisted, changeextra))
 
         sourceextra = source.extra().items()
-        srcmeta = list(filter(metanotblacklisted, sourceextra))
+        srcmeta = sorted(filter(metanotblacklisted, sourceextra))
 
         if ctxmeta != srcmeta:
             effects |= METACHANGED