changeset 4534:24662f94d126 stable

topic: only wrap committext for repo with topic This helps repository with and without topic to coexist in the same process.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Thu, 18 Apr 2019 11:13:39 +0200
parents 51317ce90bdc
children 8dae14cd076a
files hgext3rd/topic/__init__.py
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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):