Mercurial > evolve
changeset 6779:afea2dd5e7b5
topic: compatibility for scmutil.combined_filtered_and_obsolete_hash()
author | Anton Shestakov <av6@dwimlabs.net> |
---|---|
date | Fri, 17 May 2024 15:07:04 +0400 |
parents | 8e6aa420ace5 |
children | efbefcb19739 |
files | hgext3rd/topic/discovery.py |
diffstat | 1 files changed, 7 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- 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 @@ -237,12 +237,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])