obshistory: remove obsfateverb/obsfateprinter patching compatibility
authorAnton Shestakov <av6@dwimlabs.net>
Sat, 04 Jan 2020 21:07:38 +0700
changeset 5058 c95e68e8a219
parent 5057 da5cc4e493ff
child 5059 98c15ea18302
obshistory: remove obsfateverb/obsfateprinter patching compatibility obsutil.obsfateverb() was introduced in 3d0f8918351b (hg 4.4) and renamed in b81ad5b78a81 (hg 4.5). Considering the supported evolve versions, the first check is unnecessary (the condition is always True) obsutil.obsfateprinter() was introduced in e27f1f04c2cf (hg 4.4).
hgext3rd/evolve/obshistory.py
--- a/hgext3rd/evolve/obshistory.py	Fri Jan 03 23:32:48 2020 +0700
+++ b/hgext3rd/evolve/obshistory.py	Sat Jan 04 21:07:38 2020 +0700
@@ -875,39 +875,9 @@
     return {b'verb': verb}
 
 # Use a more advanced version of obsfateverb that uses effect-flag
-if util.safehasattr(obsutil, 'obsfateverb'):
-
-    @eh.wrapfunction(obsutil, 'obsfateverb')
-    def obsfateverb(orig, *args, **kwargs):
-        return _successorsetverb(*args, **kwargs)[b'verb']
-
-# Hijack callers of successorsetverb
-elif util.safehasattr(obsutil, 'obsfateprinter'):
-
-    @eh.wrapfunction(obsutil, 'obsfateprinter')
-    def obsfateprinter(orig, successors, markers, ui):
-
-        def closure(successors):
-            return _successorsetverb(successors, markers)[b'verb']
-
-        if not util.safehasattr(obsutil, 'successorsetverb'):
-            return orig(successors, markers, ui)
-
-        # Save the old value
-        old = obsutil.successorsetverb
-
-        try:
-            # Replace by own
-            obsutil.successorsetverb = closure
-
-            # Call the orig
-            result = orig(successors, markers, ui)
-
-            # And return result
-            return result
-        finally:
-            # Replace the old one
-            obsutil.successorsetverb = old
+@eh.wrapfunction(obsutil, 'obsfateverb')
+def obsfateverb(orig, *args, **kwargs):
+    return _successorsetverb(*args, **kwargs)[b'verb']
 
 FORMATSSETSFUNCTIONS = [
     _successorsetdates,