hgext3rd/topic/__init__.py
changeset 3281 703e8398ac57
parent 3235 8a772f0c54d9
child 3287 4303a46b4167
child 3291 06a3cb594956
--- 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)