evolve: stop conditional wrapping of _checkinvalidmarkers
authorPierre-Yves David <pierre-yves.david@fb.com>
Wed, 29 Apr 2015 15:12:17 -0700
changeset 1302 ebcf23fe3032
parent 1301 896d66841f7f
child 1303 508f9911b042
evolve: stop conditional wrapping of _checkinvalidmarkers We support down to Mercurial 3.3, all such version have this function.
hgext/evolve.py
--- a/hgext/evolve.py	Wed Apr 29 15:11:52 2015 -0700
+++ b/hgext/evolve.py	Wed Apr 29 15:12:17 2015 -0700
@@ -2946,21 +2946,20 @@
 _bestformat = max(obsolete.formats.keys())
 
 
-if getattr(obsolete, '_checkinvalidmarkers', None) is not None:
-    @eh.wrapfunction(obsolete, '_checkinvalidmarkers')
-    def _checkinvalidmarkers(orig, markers):
-        """search for marker with invalid data and raise error if needed
-
-        Exist as a separated function to allow the evolve extension for a more
-        subtle handling.
-        """
-        if 'debugobsconvert' in sys.argv:
-            return
-        for mark in markers:
-            if node.nullid in mark[1]:
-                raise util.Abort(_('bad obsolescence marker detected: '
-                                   'invalid successors nullid'),
-                                 hint=_('You should run `hg debugobsconvert`'))
+@eh.wrapfunction(obsolete, '_checkinvalidmarkers')
+def _checkinvalidmarkers(orig, markers):
+    """search for marker with invalid data and raise error if needed
+
+    Exist as a separated function to allow the evolve extension for a more
+    subtle handling.
+    """
+    if 'debugobsconvert' in sys.argv:
+        return
+    for mark in markers:
+        if node.nullid in mark[1]:
+            raise util.Abort(_('bad obsolescence marker detected: '
+                               'invalid successors nullid'),
+                             hint=_('You should run `hg debugobsconvert`'))
 
 @command(
     'debugobsconvert',