changeset 6784:4657010685af stable

evolve: compatibility for scmutil.combined_filtered_and_obsolete_hash()
author Anton Shestakov <av6@dwimlabs.net>
date Fri, 17 May 2024 15:06:33 +0400
parents 76c2f08b57ee
children cf1e854f50e9
files hgext3rd/evolve/headchecking.py
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/hgext3rd/evolve/headchecking.py	Sun May 26 13:03:21 2024 +0400
+++ b/hgext3rd/evolve/headchecking.py	Fri May 17 15:06:33 2024 +0400
@@ -25,10 +25,12 @@
 @eh.uisetup
 def uisetup(ui):
     extensions.wrapfunction(discovery, '_postprocessobsolete', _postprocessobsolete)
-    code = scmutil.filteredhash.__code__
-    if r'needobsolete' not in code.co_varnames[:code.co_argcount]:
-        # hg <= 6.0 (053a5bf508da)
-        extensions.wrapfunction(scmutil, 'enforcesinglehead', enforcesinglehead)
+    if util.safehasattr(scmutil, 'filteredhash'):
+        # hg <= 6.7 (a03fa40afd01)
+        code = scmutil.filteredhash.__code__
+        if 'needobsolete' not in code.co_varnames[:code.co_argcount]:
+            # hg <= 6.0 (053a5bf508da)
+            extensions.wrapfunction(scmutil, 'enforcesinglehead', enforcesinglehead)
 
 def branchinfo(pushop, repo, node):
     return repo[node].branch()