# HG changeset patch # User Anton Shestakov # Date 1715944024 -14400 # Node ID cf1e854f50e9427e6b8fdb14a59cb38eda70395c # Parent 4657010685af240dc96c9c5031ad37de3dff2d0a topic: compatibility for scmutil.combined_filtered_and_obsolete_hash() diff -r 4657010685af -r cf1e854f50e9 hgext3rd/topic/discovery.py --- a/hgext3rd/topic/discovery.py Fri May 17 15:06:33 2024 +0400 +++ b/hgext3rd/topic/discovery.py Fri May 17 15:07:04 2024 +0400 @@ -240,12 +240,13 @@ # # Handle this by doing an extra check for new head creation server side def _nbheads(repo): - code = scmutil.filteredhash.__code__ - if r'needobsolete' not in code.co_varnames[:code.co_argcount]: - # hg <= 6.0 (053a5bf508da) - filterfn = _filter_obsolete_heads - else: - filterfn = lambda repo, heads: heads + filterfn = lambda repo, heads: heads + 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) + filterfn = _filter_obsolete_heads data = {} for b in repo.branchmap().iterbranches(): namedbranch, tns, topic = common.parsefqbn(b[0])