topic: only wrap _destmergebranch for repo with topic
This helps repository with and without topic to coexist in the same process.
--- 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)