changeset 6778:8e6aa420ace5

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 8275a04db4ae
children afea2dd5e7b5
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:49:02 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()