mercurial/context.py
changeset 44051 436d106de670
parent 44050 2ecbc4ec87d8
child 44052 b74270da5eee
--- a/mercurial/context.py	Fri Jan 10 17:03:23 2020 -0800
+++ b/mercurial/context.py	Fri Jan 10 21:41:28 2020 -0800
@@ -2161,6 +2161,10 @@
         # ``overlayworkingctx`` (e.g. with --collapse).
         util.clearcachedproperty(self, b'_manifest')
 
+    def setparents(self, p1node, p2node=nullid):
+        assert p1node == self._wrappedctx.node()
+        self._parents = [self._wrappedctx, self._repo.unfiltered()[p2node]]
+
     def data(self, path):
         if self.isdirty(path):
             if self._cache[path][b'exists']:
@@ -2415,9 +2419,9 @@
         ``text`` is the commit message.
         ``parents`` (optional) are rev numbers.
         """
-        # Default parents to the wrapped contexts' if not passed.
+        # Default parents to the wrapped context if not passed.
         if parents is None:
-            parents = self._wrappedctx.parents()
+            parents = self.parents()
             if len(parents) == 1:
                 parents = (parents[0], None)