effect-flag: fix obsfate verb hooking
authorBoris Feld <boris.feld@octobus.net>
Tue, 14 Nov 2017 18:35:25 +0100
changeset 3181 5db76f35efce
parent 3180 85ab7d2d9fd6
child 3195 8f74cf219be3
effect-flag: fix obsfate verb hooking Mercurial core commit b81ad5b78a81 renamed a the function we hooked on and update its signature. Update the code to detect that, which fixes tests errors.
hgext3rd/evolve/obshistory.py
--- a/hgext3rd/evolve/obshistory.py	Tue Nov 07 14:07:19 2017 +0100
+++ b/hgext3rd/evolve/obshistory.py	Tue Nov 14 18:35:25 2017 +0100
@@ -787,8 +787,15 @@
         verb = 'split'
     return {'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)['verb']
+
 # Hijack callers of successorsetverb
-if util.safehasattr(obsutil, 'obsfateprinter'):
+elif util.safehasattr(obsutil, 'obsfateprinter'):
 
     @eh.wrapfunction(obsutil, 'obsfateprinter')
     def obsfateprinter(orig, successors, markers, ui):