compat: adapt to rebase change in coming 4.4
authorBoris Feld <boris.feld@octobus.net>
Fri, 01 Sep 2017 11:07:28 +0200
changeset 2891 b18d2b2f18a6
parent 2890 1e3d97486861
child 2892 0eed6678b150
compat: adapt to rebase change in coming 4.4 Make evolve works with mercurial core 72b5f4d53c58
hgext3rd/topic/destination.py
--- a/hgext3rd/topic/destination.py	Thu Aug 31 13:22:40 2017 +0200
+++ b/hgext3rd/topic/destination.py	Fri Sep 01 11:07:28 2017 +0200
@@ -106,9 +106,14 @@
         rebase = extensions.find('rebase')
     except KeyError:
         rebase = None
+
+    # Mercurial 4.4 rename _definesets into _definedestmap
+    rebasebefore38 = not util.safehasattr(rebase, '_definesets')
+    rebasebefore44 = not util.safehasattr(rebase, '_definedestmap')
+
     if (util.safehasattr(rebase, '_destrebase')
             # logic not shared with merge yet < hg-3.8
-            and not util.safehasattr(rebase, '_definesets')):
+            and rebasebefore38 and rebasebefore44):
         extensions.wrapfunction(rebase, '_destrebase', _destmergebranch)
     if util.safehasattr(destutil, 'destupdatesteps'):
         bridx = destutil.destupdatesteps.index('branch')