# HG changeset patch # User Anton Shestakov # Date 1679010175 10800 # Node ID 31296f71c1218a9cba8cf004fdf549c57820086e # Parent 2a2fde6c0aecafecec7ed936799b0ede755f9651 precheck: use getargspec() instead of using __code__ for checking arguments Apparently when precheck() in core was wrapped in functools.partial(), this code was broken ("functools.partial has no attribute '__code__'"). diff -r 2a2fde6c0aec -r 31296f71c121 hgext3rd/evolve/rewriteutil.py --- a/hgext3rd/evolve/rewriteutil.py Thu Mar 16 20:29:53 2023 -0300 +++ b/hgext3rd/evolve/rewriteutil.py Thu Mar 16 20:42:55 2023 -0300 @@ -23,6 +23,7 @@ node, obsolete, obsutil, + pycompat, revset, rewriteutil as corerewriteutil, scmutil, @@ -60,8 +61,8 @@ can be used to control the commit message. """ # hg <= 6.1 (d4752aeb20f1) - code = corerewriteutil.precheck.__code__ - if r'check_divergence' in code.co_varnames[:code.co_argcount]: + args = pycompat.getargspec(corerewriteutil.precheck).args + if r'check_divergence' in args: return corerewriteutil.precheck(repo, revs, action, check_divergence=check_divergence)