topic: only wrap _destmergebranch for repo with topic stable
authorPierre-Yves David <pierre-yves.david@octobus.net>
Thu, 18 Apr 2019 12:39:41 +0200
branchstable
changeset 4537 db3e17adee3e
parent 4536 9837e8d378de
child 4538 31c1645ef8bf
topic: only wrap _destmergebranch for repo with topic This helps repository with and without topic to coexist in the same process.
hgext3rd/topic/destination.py
--- a/hgext3rd/topic/destination.py	Thu Apr 18 12:36:11 2019 +0200
+++ b/hgext3rd/topic/destination.py	Thu Apr 18 12:39:41 2019 +0200
@@ -7,7 +7,10 @@
     error,
     extensions,
 )
-from . import topicmap
+from . import (
+    common,
+    topicmap,
+)
 from .evolvebits import builddependencies
 
 def _destmergebranch(orig, repo, action='merge', sourceset=None,
@@ -19,7 +22,9 @@
         # XXX: using only the max here is flacky. That code should eventually
         # be updated to take care of the whole sourceset.
         p1 = repo[max(sourceset)]
-    top = p1.topic()
+    top = None
+    if common.hastopicext(repo):
+        top = p1.topic()
     if top:
         revs = repo.revs('topic(%s) - obsolete()', top)
         deps, rdeps = builddependencies(repo, revs)