Skip to content
Snippets Groups Projects
Commit bf279164 authored by Manuel Jacob's avatar Manuel Jacob
Browse files

compat: fix compatibility with upstream Mercurial

Mercurial changeset 3b7aabd02e11 changed some code from `repo[ctx.p1().node()]`
to `ctx.p1()`. `ctx.p1()` is using `ctx._parents`. The base class’s `_parents`
returns instances of type `changectx` instead of `overlaychangectx`, leading to
a crash later. Therefore we override `_parents` instead of `parents()`.

The base class’s `parents()` method returns `self._parents`, so the return value
of `parents()` is unchanged.
parent f57d5dba
No related branches found
No related tags found
2 merge requests!37compat: fix compatibility with upstream Mercurial,!34Require dulwich < 0.20.0 on Python 2.
Pipeline #8203 passed
......@@ -263,7 +263,8 @@
def description(self):
return self.commit.message
def parents(self):
@util.propertycache
def _parents(self):
cl = self.repo().changelog
parents = cl.parents(cl.node(self._rev))
if not parents:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment