changeset 6124:cd313b2e57fb

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.
author Anton Shestakov <av6@dwimlabs.net>
date Sat, 05 Feb 2022 11:08:12 +0300
parents 5e14782908e4
children 885a972d5069
files hgext3rd/evolve/headchecking.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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()