compat: use older API for older version
authorPierre-Yves David <pierre-yves.david@octobus.net>
Tue, 31 Jul 2018 11:25:57 +0200
changeset 3908 2af10d0a59e0
parent 3906 f2cde417a738
child 3909 f7afd3a158e3
child 3914 96945ea908df
child 3918 66a863bb6401
compat: use older API for older version This API changed in 4.7, we need to adjust.
hgext3rd/evolve/compat.py
--- 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: