# HG changeset patch # User Pierre-Yves David # Date 1608727785 -3600 # Node ID 4de216446c534d8ba4f379d93192b5352a65e6b5 # Parent 1dece375d2ab3284dbdb6aae6ad8e726c83a5cda topic: also wrap the `ctx.branch` of parents `hg summary` will do some comparison between the current branch and the parents branch, so we need that covered too. diff -r 1dece375d2ab -r 4de216446c53 hgext3rd/topic/discovery.py --- a/hgext3rd/topic/discovery.py Wed Dec 23 13:36:02 2020 +0100 +++ b/hgext3rd/topic/discovery.py Wed Dec 23 13:49:45 2020 +0100 @@ -30,6 +30,7 @@ def __getitem__(self, key): ctx = super(repocls, self).__getitem__(key) oldbranch = ctx.branch + oldparents = ctx.parents rev = ctx.rev() def branch(): @@ -41,7 +42,27 @@ branch = b"%s:%s" % (branch, topic) return branch + def parents(): + parents = oldparents() + for p in parents: + if getattr(p, '_topic_ext_branch_hack', False): + continue + pbranch = p.branch + + def branch(): + branch = pbranch() + if p.rev() in publishedset: + return branch + topic = p.topic() + if topic: + branch = b"%s:%s" % (branch, topic) + return branch + p.branch = branch + p._topic_ext_branch_hack = True + return parents + ctx.branch = branch + ctx.parents = parents return ctx def revbranchcache(self):