topic: only wrap committext for repo with topic stable
authorPierre-Yves David <pierre-yves.david@octobus.net>
Thu, 18 Apr 2019 11:13:39 +0200
branchstable
changeset 4534 24662f94d126
parent 4533 51317ce90bdc
child 4535 8dae14cd076a
topic: only wrap committext for repo with topic This helps repository with and without topic to coexist in the same process.
hgext3rd/topic/__init__.py
--- 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):