memctx: create parent contexts using "repo[p]" syntax
authorMartin von Zweigbergk <martinvonz@google.com>
Thu, 29 Mar 2018 22:22:51 -0700
changeset 37173 05ff1a155a21
parent 37172 daef13da66fe
child 37174 bb47dc2f71a0
memctx: create parent contexts using "repo[p]" syntax I want to reduce dependence on basectx.__new__() and move that code over to repo.__getitem__(). Differential Revision: https://phab.mercurial-scm.org/D2968
mercurial/context.py
--- a/mercurial/context.py	Thu Mar 29 21:29:15 2018 -0700
+++ b/mercurial/context.py	Thu Mar 29 22:22:51 2018 -0700
@@ -2284,7 +2284,7 @@
         self._node = None
         parents = [(p or nullid) for p in parents]
         p1, p2 = parents
-        self._parents = [changectx(self._repo, p) for p in (p1, p2)]
+        self._parents = [self._repo[p] for p in (p1, p2)]
         files = sorted(set(files))
         self._files = files
         if branch is not None: