changeset 39920:bae6f1418a95

obsolete: explicitly pass relation items to effectflag computation To track folds, we are about to change the content of `rel`. To simplify this change, we update the `geteffectflag` function beforehand.
author Boris Feld <boris.feld@octobus.net>
date Wed, 26 Sep 2018 23:37:43 +0200
parents 0428feb1f0d7
children 99f0f052b6bf
files mercurial/obsolete.py mercurial/obsutil.py
diffstat 2 files changed, 3 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/obsolete.py	Wed Sep 26 22:45:44 2018 +0200
+++ b/mercurial/obsolete.py	Wed Sep 26 23:37:43 2018 +0200
@@ -1016,7 +1016,7 @@
             if saveeffectflag:
                 # The effect flag is saved in a versioned field name for future
                 # evolution
-                effectflag = obsutil.geteffectflag(rel)
+                effectflag = obsutil.geteffectflag(prec, sucs)
                 localmetadata[obsutil.EFFECTFLAGFIELD] = "%d" % effectflag
 
             # Creating the marker causes the hidden cache to become invalid,
--- a/mercurial/obsutil.py	Wed Sep 26 22:45:44 2018 +0200
+++ b/mercurial/obsutil.py	Wed Sep 26 23:37:43 2018 +0200
@@ -413,15 +413,13 @@
             return False
     return True
 
-def geteffectflag(relation):
+def geteffectflag(source, successors):
     """ From an obs-marker relation, compute what changed between the
     predecessor and the successor.
     """
     effects = 0
 
-    source = relation[0]
-
-    for changectx in relation[1]:
+    for changectx in successors:
         # Check if description has changed
         if changectx.description() != source.description():
             effects |= DESCCHANGED