changeset 6218:635b95454cce

precheck: compatibility with hg 6.2 (check_divergence keyword argument)
author Anton Shestakov <av6@dwimlabs.net>
date Sun, 27 Mar 2022 15:06:32 +0300
parents 4466989cee8d
children b5c57fb2ffde
files hgext3rd/evolve/rewriteutil.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/hgext3rd/evolve/rewriteutil.py	Fri Jul 23 00:34:29 2021 +0530
+++ b/hgext3rd/evolve/rewriteutil.py	Sun Mar 27 15:06:32 2022 +0300
@@ -59,9 +59,9 @@
 
     <action> can be used to control the commit message.
     """
-    # If this attribute exists, then core's rewriteutil is recent enough
-    # that it has all the features from our own implementation.
-    if util.safehasattr(corerewriteutil, 'find_new_divergence_from'):
+    # hg <= 6.1 (d4752aeb20f1)
+    code = corerewriteutil.precheck.__code__
+    if r'check_divergence' in code.co_varnames[:code.co_argcount]:
         return corerewriteutil.precheck(repo, revs, action,
                                         check_divergence=check_divergence)