# HG changeset patch # User Sean Farley # Date 2018-05-22 14:16:11 # Node ID a5dafefc4a53294aa0bd88a27cc29baf2a1ea62c # Parent 15e86ecf6b269738849fe9582eb6599d8ed30fb2 memctx: simplify _manifest with new revlog nodeids This was originally written before we had modifiednodeid and addednodeid, so we had to get the parents of the context, the data from the function, and then hash that. This is much more simple now and helps refactor more code later. diff --git a/mercurial/context.py b/mercurial/context.py --- a/mercurial/context.py +++ b/mercurial/context.py @@ -36,7 +36,6 @@ from . import ( phases, pycompat, repoview, - revlog, scmutil, sparse, subrepo, @@ -2287,17 +2286,10 @@ class memctx(committablectx): man = pctx.manifest().copy() for f in self._status.modified: - p1node = nullid - p2node = nullid - p = pctx[f].parents() # if file isn't in pctx, check p2? - if len(p) > 0: - p1node = p[0].filenode() - if len(p) > 1: - p2node = p[1].filenode() - man[f] = revlog.hash(self[f].data(), p1node, p2node) + man[f] = modifiednodeid for f in self._status.added: - man[f] = revlog.hash(self[f].data(), nullid, nullid) + man[f] = addednodeid for f in self._status.removed: if f in man: