changeset 3707:95ee7bf46ade stable

compat: handle lack of allpredecessors for Mercurial 4.3
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 24 Apr 2018 12:07:35 +0100
parents 47e6776c2ef0
children d7a89d5b3684
files hgext3rd/evolve/evolvecmd.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hgext3rd/evolve/evolvecmd.py	Mon Apr 23 12:03:05 2018 +0100
+++ b/hgext3rd/evolve/evolvecmd.py	Tue Apr 24 12:07:35 2018 +0100
@@ -1020,7 +1020,10 @@
     """Compute sets of commits divergent with a given one"""
     cache = {}
     base = {}
-    for n in obsutil.allpredecessors(repo.obsstore, [ctx.node()]):
+    allpredecessors = getattr(obsutil, 'allpredecessors', None)
+    if allpredecessors is None: # <= Mercurial 4.3
+        allpredecessors = obsutil.allprecursors
+    for n in allpredecessors(repo.obsstore, [ctx.node()]):
         if n == ctx.node():
             # a node can't be a base for divergence with itself
             continue