memctx: simplify _manifest with new revlog nodeids
authorSean Farley <sean@farley.io>
Tue, 22 May 2018 16:16:11 +0200
changeset 39713 a5dafefc4a53
parent 39712 15e86ecf6b26
child 39714 491fc3f4be67
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.
mercurial/context.py
--- 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: