# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 1523038367 -19800 # Node ID fa15068a9945d4b1d1676750d478ee523b55eafc # Parent 35ffd7a4b3399f5b2a4b51474c8fccc15a963c95 serverminitopic: wrap context.changectx.branch instead of context.changectx Recently some changes in core resulted in this wrapping of class leading to an infinite recursion. Let's wrap the particular function instead of wrapping the whole command. This fixes test-minitopic.t which was breaking. diff -r 35ffd7a4b339 -r fa15068a9945 hgext3rd/serverminitopic.py --- a/hgext3rd/serverminitopic.py Fri Apr 06 17:53:41 2018 +0200 +++ b/hgext3rd/serverminitopic.py Fri Apr 06 23:42:47 2018 +0530 @@ -43,17 +43,14 @@ ### make topic visible though "ctx.branch()" -class topicchangectx(context.changectx): - """a sunclass of changectx that add topic to the branch name""" - - def branch(self): - branch = super(topicchangectx, self).branch() - if hasminitopic(self._repo) and self.phase(): - topic = self._changeset.extra.get('topic') - if topic is not None: - topic = encoding.tolocal(topic) - branch = '%s:%s' % (branch, topic) - return branch +def topicbranch(orig, self): + branch = orig(self) + if hasminitopic(self._repo) and self.phase(): + topic = self._changeset.extra.get('topic') + if topic is not None: + topic = encoding.tolocal(topic) + branch = '%s:%s' % (branch, topic) + return branch ### avoid caching topic data in rev-branch-cache @@ -220,7 +217,7 @@ assert issubclass(current, new), (current, new, targetclass) def uisetup(ui): - wrapclass(context, 'changectx', topicchangectx) wrapclass(branchmap, 'branchcache', _topiccache) extensions.wrapfunction(branchmap, 'read', wrapread) extensions.wrapfunction(wireproto, '_capabilities', wireprotocaps) + extensions.wrapfunction(context.changectx, 'branch', topicbranch)