From patchwork Tue Jan 7 00:59:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D7801: overlwayworkingctx: remove doubly bad reference to wrapped ctx for copies From: phabricator X-Patchwork-Id: 44164 Message-Id: To: Phabricator Cc: mercurial-devel@mercurial-scm.org Date: Tue, 7 Jan 2020 00:59:32 +0000 martinvonz created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY `_wrappedctx` lives on overlwayworkingctx, not on the repo object, so we should access it as `._wrappedctx`, not `._repo._wrappedctx`. More importantly, the overlayworkingctx is relative to its base, not including it, so the copies returned should not include copies made in the base. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D7801 AFFECTED FILES mercurial/context.py CHANGE DETAILS To: martinvonz, #hg-reviewers Cc: mercurial-devel diff --git a/mercurial/context.py b/mercurial/context.py --- a/mercurial/context.py +++ b/mercurial/context.py @@ -2218,7 +2218,7 @@ ] def p1copies(self): - copies = self._repo._wrappedctx.p1copies().copy() + copies = {} narrowmatch = self._repo.narrowmatch() for f in self._cache.keys(): if not narrowmatch(f): @@ -2230,7 +2230,7 @@ return copies def p2copies(self): - copies = self._repo._wrappedctx.p2copies().copy() + copies = {} narrowmatch = self._repo.narrowmatch() for f in self._cache.keys(): if not narrowmatch(f):