changeset 2891:b18d2b2f18a6

compat: adapt to rebase change in coming 4.4 Make evolve works with mercurial core 72b5f4d53c58
author Boris Feld <boris.feld@octobus.net>
date Fri, 01 Sep 2017 11:07:28 +0200
parents 1e3d97486861
children 0eed6678b150
files hgext3rd/topic/destination.py
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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')