# HG changeset patch # User Anton Shestakov # Date 1644141917 -10800 # Node ID 885a972d506963ad46af05819e7d84d0223e694b # Parent cd313b2e57fbad8b39bc748bfd82b9ab90bcee6d topic: no need to filter obsolete heads in Mercurial 6.1 diff -r cd313b2e57fb -r 885a972d5069 hgext3rd/topic/discovery.py --- a/hgext3rd/topic/discovery.py Sat Feb 05 11:08:12 2022 +0300 +++ b/hgext3rd/topic/discovery.py Sun Feb 06 13:05:17 2022 +0300 @@ -217,12 +217,18 @@ # # 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 data = {} for b in repo.branchmap().iterbranches(): if b':' in b[0]: continue oldheads = [repo[n].rev() for n in b[1]] - newheads = _filter_obsolete_heads(repo, oldheads) + newheads = filterfn(repo, oldheads) data[b[0]] = newheads return data