# HG changeset patch # User Manuel Jacob # Date 1594426399 -7200 # Node ID d085fcb11c56d1070035a467a763d356b18c61d0 # Parent 3e40abe0a170774a8c4cafa156d747de66580b5f memctx: make `parents()` return list of one element if it’s not a merge It is part of the contract of `parents()` that non-merges return a list of one element. `self._parents` is always a list of two elements in `memctx`. Differential Revision: https://phab.mercurial-scm.org/D8731 diff -r 3e40abe0a170 -r d085fcb11c56 mercurial/context.py --- a/mercurial/context.py Sat Jul 11 01:14:00 2020 +0200 +++ b/mercurial/context.py Sat Jul 11 02:13:19 2020 +0200 @@ -2891,6 +2891,11 @@ return scmutil.status(modified, added, removed, [], [], [], []) + def parents(self): + if self._parents[1].node() == nullid: + return [self._parents[0]] + return self._parents + class memfilectx(committablefilectx): """memfilectx represents an in-memory file to commit.