Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/context.py @ 44040:f652b7ddc1d4
overlwayworkingctx: remove doubly bad reference to wrapped ctx for copies
`_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.
Differential Revision: https://phab.mercurial-scm.org/D7801
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Fri, 27 Dec 2019 14:08:02 -0800 |
parents | 3216cabffd4a |
children | 2ecbc4ec87d8 |
comparison
equal
deleted
inserted
replaced
44039:0750cbffdb3b | 44040:f652b7ddc1d4 |
---|---|
2222 for f in self._cache.keys() | 2222 for f in self._cache.keys() |
2223 if not self._cache[f][b'exists'] and self._existsinparent(f) | 2223 if not self._cache[f][b'exists'] and self._existsinparent(f) |
2224 ] | 2224 ] |
2225 | 2225 |
2226 def p1copies(self): | 2226 def p1copies(self): |
2227 copies = self._repo._wrappedctx.p1copies().copy() | 2227 copies = {} |
2228 narrowmatch = self._repo.narrowmatch() | 2228 narrowmatch = self._repo.narrowmatch() |
2229 for f in self._cache.keys(): | 2229 for f in self._cache.keys(): |
2230 if not narrowmatch(f): | 2230 if not narrowmatch(f): |
2231 continue | 2231 continue |
2232 copies.pop(f, None) # delete if it exists | 2232 copies.pop(f, None) # delete if it exists |
2234 if source: | 2234 if source: |
2235 copies[f] = source | 2235 copies[f] = source |
2236 return copies | 2236 return copies |
2237 | 2237 |
2238 def p2copies(self): | 2238 def p2copies(self): |
2239 copies = self._repo._wrappedctx.p2copies().copy() | 2239 copies = {} |
2240 narrowmatch = self._repo.narrowmatch() | 2240 narrowmatch = self._repo.narrowmatch() |
2241 for f in self._cache.keys(): | 2241 for f in self._cache.keys(): |
2242 if not narrowmatch(f): | 2242 if not narrowmatch(f): |
2243 continue | 2243 continue |
2244 copies.pop(f, None) # delete if it exists | 2244 copies.pop(f, None) # delete if it exists |