# HG changeset patch # User Pierre-Yves David # Date 1499006388 -7200 # Node ID a32afe67e8a60501b01491d1cdd1d1da77e99645 # Parent b4824e169f18a422a465f7a2037dd76847920723 topic: also have the revbranchcache during the discovery diff -r b4824e169f18 -r a32afe67e8a6 hgext3rd/topic/discovery.py --- a/hgext3rd/topic/discovery.py Sun Jul 02 16:00:38 2017 +0200 +++ b/hgext3rd/topic/discovery.py Sun Jul 02 16:39:48 2017 +0200 @@ -35,6 +35,7 @@ return orig(*args) class repocls(repo.__class__): + # awful hack to see branch as "branch:topic" def __getitem__(self, key): ctx = super(repocls, self).__getitem__(key) oldbranch = ctx.branch @@ -49,6 +50,20 @@ ctx.branch = branch return ctx + def revbranchcache(self): + rbc = super(repocls, self).revbranchcache() + changelog = self.changelog + + def branchinfo(rev): + branch, close = changelog.branchinfo(rev) + topic = repo[rev].topic() + if topic: + branch = "%s:%s" % (branch, topic) + return branch, close + + rbc.branchinfo = branchinfo + return rbc + oldrepocls = repo.__class__ try: repo.__class__ = repocls