# HG changeset patch # User Martin von Zweigbergk # Date 1547846028 28800 # Node ID aa84bc48c2f710b41352f7b0045aa8cf838e0733 # Parent f0def07fa82fb436e493a1beddfeb351ed9e4822 getrenamedfn: get copy data from context object if configured The function returned from getrenamedfn() calls filelog.renamed(). That won't work when storing copy metadata in the changeset. I've just switched to a simple implementation here. We may or may not need to optimize it later, possibly by optimizing the callers. No more tests fail with "--extra-config-opt experimental.copies.read-from=compatibility)" than they did before this patch. Differential Revision: https://phab.mercurial-scm.org/D6162 diff -r f0def07fa82f -r aa84bc48c2f7 mercurial/scmutil.py --- a/mercurial/scmutil.py Sun Mar 31 16:27:10 2019 +0300 +++ b/mercurial/scmutil.py Fri Jan 18 13:13:48 2019 -0800 @@ -1205,6 +1205,18 @@ wctx.copy(old, new) def getrenamedfn(repo, endrev=None): + if repo.ui.config('experimental', 'copies.read-from') == 'compatibility': + def getrenamed(fn, rev): + ctx = repo[rev] + p1copies = ctx.p1copies() + if fn in p1copies: + return p1copies[fn] + p2copies = ctx.p2copies() + if fn in p2copies: + return p2copies[fn] + return None + return getrenamed + rcache = {} if endrev is None: endrev = len(repo)