# HG changeset patch # User Anton Shestakov # Date 1578146858 -25200 # Node ID c95e68e8a2192e197399f8c136ef5de3a9766d9e # Parent da5cc4e493ff97f961b5b547f958b2525838f402 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). diff -r da5cc4e493ff -r c95e68e8a219 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,