changeset 39729:a5dafefc4a53

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.
author Sean Farley <sean@farley.io>
date Tue, 22 May 2018 16:16:11 +0200
parents 15e86ecf6b26
children 491fc3f4be67
files mercurial/context.py
diffstat 1 files changed, 2 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/context.py	Tue May 22 12:35:38 2018 +0200
+++ b/mercurial/context.py	Tue May 22 16:16:11 2018 +0200
@@ -36,7 +36,6 @@
     phases,
     pycompat,
     repoview,
-    revlog,
     scmutil,
     sparse,
     subrepo,
@@ -2287,17 +2286,10 @@
         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: