topic: only wrap committext for repo with topic
This helps repository with and without topic to coexist in the same process.
--- a/hgext3rd/topic/__init__.py Thu Apr 18 11:13:24 2019 +0200
+++ b/hgext3rd/topic/__init__.py Thu Apr 18 11:13:39 2019 +0200
@@ -1165,10 +1165,11 @@
def committextwrap(orig, repo, ctx, subs, extramsg):
ret = orig(repo, ctx, subs, extramsg)
- t = repo.currenttopic
- if t:
- ret = ret.replace("\nHG: branch",
- "\nHG: topic '%s'\nHG: branch" % t)
+ if hastopicext(repo):
+ t = repo.currenttopic
+ if t:
+ ret = ret.replace("\nHG: branch",
+ "\nHG: topic '%s'\nHG: branch" % t)
return ret
def pushoutgoingwrap(orig, ui, repo, *args, **opts):