compat: drop 4.3 wrapping of createmarker for effect flag support
authorPierre-Yves David <pierre-yves.david@octobus.net>
Mon, 19 Nov 2018 02:18:58 +0000
changeset 4260 cd0c331c430a
parent 4259 bccd5c2786ba
child 4261 47f569581ad2
compat: drop 4.3 wrapping of createmarker for effect flag support This is supported natively in 4.4 and above.
hgext3rd/evolve/obshistory.py
--- a/hgext3rd/evolve/obshistory.py	Mon Nov 19 01:52:45 2018 +0000
+++ b/hgext3rd/evolve/obshistory.py	Mon Nov 19 02:18:58 2018 +0000
@@ -14,7 +14,6 @@
     error,
     graphmod,
     patch,
-    obsolete,
     obsutil,
     node as nodemod,
     scmutil,
@@ -863,49 +862,6 @@
             return False
     return True
 
-# Wrap pre Mercurial 4.4 createmarkers that didn't included effect-flag
-if not util.safehasattr(obsutil, 'geteffectflag'):
-    @eh.wrapfunction(obsolete, 'createmarkers')
-    def createmarkerswithbits(orig, repo, relations, flag=0, date=None,
-                              metadata=None, **kwargs):
-        """compute 'effect-flag' and augment the created markers
-
-        Wrap obsolete.createmarker in order to compute the effect of each
-        relationship and store them as flag in the metadata.
-
-        While we experiment, we store flag in a metadata field. This field is
-        "versionned" to easilly allow moving to other meaning for flags.
-
-        The comparison of description or other infos just before creating the obs
-        marker might induce overhead in some cases. However it is a good place to
-        start since it automatically makes all markers creation recording more
-        meaningful data. In the future, we can introduce way for commands to
-        provide precomputed effect to avoid the overhead.
-        """
-        if not repo.ui.configbool('experimental', 'evolution.effect-flags', **efd):
-            return orig(repo, relations, flag, date, metadata, **kwargs)
-        if metadata is None:
-            metadata = {}
-        tr = repo.transaction('add-obsolescence-marker')
-        try:
-            for r in relations:
-                # Compute the effect flag for each obsmarker
-                effect = geteffectflag(r)
-
-                # Copy the metadata in order to add them, we copy because the
-                # effect flag might be different per relation
-                m = metadata.copy()
-                # we store the effect even if "0". This disctinct markers created
-                # without the feature with markers recording a no-op.
-                m['ef1'] = "%d" % effect
-
-                # And call obsolete.createmarkers for creating the obsmarker for real
-                orig(repo, [r], flag, date, m, **kwargs)
-
-            tr.close()
-        finally:
-            tr.release()
-
 def _getobsfate(successorssets):
     """ Compute a changeset obsolescence fate based on his successorssets.
     Successors can be the tipmost ones or the immediate ones.