compat: adapt to buildobsmarkerspart move
authorPierre-Yves David <pierre-yves.david@octobus.net>
Fri, 26 May 2017 14:47:33 +0200
changeset 2523 3629446411b3
parent 2522 a1cc2a0b9f6f
child 2524 d912380ec685
compat: adapt to buildobsmarkerspart move The function has been moved in e70d6dbde713 so we must we search in both location.
hgext3rd/evolve/obsexchange.py
--- a/hgext3rd/evolve/obsexchange.py	Tue May 30 11:06:24 2017 +0200
+++ b/hgext3rd/evolve/obsexchange.py	Fri May 26 14:47:33 2017 +0200
@@ -18,6 +18,7 @@
 import socket
 
 from mercurial import (
+    bundle2,
     error,
     exchange,
     extensions,
@@ -98,7 +99,10 @@
             subset = [c.node() for c in repo.unfiltered().set('only(%ln, %ln)', heads, common)]
             subset += kwargs['evo_missing_nodes']
         markers = repo.obsstore.relevantmarkers(subset)
-        exchange.buildobsmarkerspart(bundler, markers)
+        if util.safehasattr(bundle2, 'buildobsmarkerspart'):
+            bundle2.buildobsmarkerspart(bundler, markers)
+        else:
+            exchange.buildobsmarkerspart(bundler, markers)
 
 # manual wrap up in extsetup because of the wireproto.commands mapping
 def _obscommon_capabilities(orig, repo, proto):