# HG changeset patch # User Martin von Zweigbergk # Date 1553273107 25200 # Node ID d48a480af9ab256c8ae3360167d5e34d7885aea1 # Parent 2eafdca7ba4b74407f5d37cb1cd85adf3efc0164 compat: add support for new arg name in memfilectx.__init__ This makes us compatible with 550a172a603b (memctx: rename constructor argument "copied" to "copysource" (API), 2019-03-19). diff -r 2eafdca7ba4b -r d48a480af9ab hgext3rd/evolve/compat.py --- a/hgext3rd/evolve/compat.py Wed Mar 13 17:32:14 2019 +0530 +++ b/hgext3rd/evolve/compat.py Fri Mar 22 09:45:07 2019 -0700 @@ -81,9 +81,14 @@ def memfilectx(repo, ctx, fctx, flags, copied, path): # XXX Would it be better at the module level? varnames = context.memfilectx.__init__.__code__.co_varnames - ctxmandatory = varnames[2] == "changectx" - if ctxmandatory: + if "copysource" in varnames: + mctx = context.memfilectx(repo, ctx, fctx.path(), fctx.data(), + islink='l' in flags, + isexec='x' in flags, + copysource=copied.get(path)) + # compat with hg <- 4.9 + elif varnames[2] == "changectx": mctx = context.memfilectx(repo, ctx, fctx.path(), fctx.data(), islink='l' in flags, isexec='x' in flags,