# HG changeset patch # User Anton Shestakov # Date 1644048492 -10800 # Node ID cd313b2e57fbad8b39bc748bfd82b9ab90bcee6d # Parent 5e14782908e4bcb6bf7caa7e3edc779c6fa5e8e4 evolve: enforcesinglehead() in 6.1 covers all our needs The only difference this function has in core and in evolve is a call to _filter_obsolete_heads(), but since now head computation in core is obsolescence-aware, there's no need to filter heads twice. And with that the only reason for calling evolve's version of enforcesinglehead() is gone. diff -r 5e14782908e4 -r cd313b2e57fb hgext3rd/evolve/headchecking.py --- a/hgext3rd/evolve/headchecking.py Mon Dec 27 18:40:04 2021 +0300 +++ b/hgext3rd/evolve/headchecking.py Sat Feb 05 11:08:12 2022 +0300 @@ -25,7 +25,10 @@ @eh.uisetup def uisetup(ui): extensions.wrapfunction(discovery, '_postprocessobsolete', _postprocessobsolete) - extensions.wrapfunction(scmutil, 'enforcesinglehead', enforcesinglehead) + code = scmutil.filteredhash.__code__ + if r'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()