diff -r e642bad8174a -r 703e8398ac57 hgext3rd/topic/__init__.py --- a/hgext3rd/topic/__init__.py Tue Dec 12 00:16:55 2017 +0100 +++ b/hgext3rd/topic/__init__.py Tue Dec 12 01:27:12 2017 +0100 @@ -322,6 +322,10 @@ cmdutil.summaryhooks.add('topic', summaryhook) + # Wrap workingctx extra to return the topic name + extensions.wrapfunction(context.workingctx, '__init__', wrapinit) + # Wrap changelog.add to drop empty topic + extensions.wrapfunction(changelog.changelog, 'add', wrapadd) def reposetup(ui, repo): if not isinstance(repo, localrepo.localrepository): @@ -483,10 +487,6 @@ repo.names.addnamespace(namespaces.namespace( 'topics', 'topic', namemap=_namemap, nodemap=_nodemap, listnames=lambda repo: repo.topics)) - # Wrap workingctx extra to return the topic name - extensions.wrapfunction(context.workingctx, '__init__', wrapinit) - # Wrap changelog.add to drop empty topic - extensions.wrapfunction(changelog.changelog, 'add', wrapadd) def wrapinit(orig, self, repo, *args, **kwargs): orig(self, repo, *args, **kwargs)