changeset 3908:2af10d0a59e0

compat: use older API for older version This API changed in 4.7, we need to adjust.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 31 Jul 2018 11:25:57 +0200
parents f2cde417a738
children f7afd3a158e3 96945ea908df 66a863bb6401
files hgext3rd/evolve/compat.py
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/hgext3rd/evolve/compat.py	Wed Jul 25 16:12:01 2018 -0700
+++ b/hgext3rd/evolve/compat.py	Tue Jul 31 11:25:57 2018 +0200
@@ -234,8 +234,12 @@
     # an endpoint is "dirty" if it isn't a descendant of the merge base
     # if we have a dirty endpoint, we need to trigger graft logic, and also
     # keep track of which endpoint is dirty
-    dirtyc1 = not base.isancestorof(_c1)
-    dirtyc2 = not base.isancestorof(_c2)
+    if util.safehasattr(base, 'isancestorof'):
+        dirtyc1 = not base.isancestorof(_c1)
+        dirtyc2 = not base.isancestorof(_c2)
+    else: # hg <= 4.6
+        dirtyc1 = not base.descendant(_c1)
+        dirtyc2 = not base.descendant(_c2)
     graft = dirtyc1 or dirtyc2
     tca = base
     if graft: