Mercurial > hg
changeset 27983:b7af616ca675
memctx: fix memctx manifest file hashes
When memctx is asked for a manifest, it constructs one by merging the p1
manifest, and the changes that are on top. For the changes on top, it was
previously using p1.node() as the file entries parent, which actually returns
the commit node that the p1 linkrev points at! Which is entirely incorrect.
The fix is to use p1.filenode() instead, which returns the parent file node as
desired.
I don't know how to execute this or make it have a visible effect, so I'm not
sure how to test it. It was noticed because asking for the linkrev is an
expensive operation when using the remotefilelog extension and this was causing
performance regressions with commit.
author | Durham Goode <durham@fb.com> |
---|---|
date | Wed, 03 Feb 2016 17:44:11 -0800 |
parents | bf1d5c223ac0 |
children | e60e13a86529 |
files | mercurial/context.py |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/context.py Fri Jan 29 14:53:44 2016 -0500 +++ b/mercurial/context.py Wed Feb 03 17:44:11 2016 -0800 @@ -1892,9 +1892,9 @@ p2node = nullid p = pctx[f].parents() # if file isn't in pctx, check p2? if len(p) > 0: - p1node = p[0].node() + p1node = p[0].filenode() if len(p) > 1: - p2node = p[1].node() + p2node = p[1].filenode() man[f] = revlog.hash(self[f].data(), p1node, p2node) for f in self._status.added: