obsdiscovery: factor the "do we push markers" check out
This clarify the code a bit.
--- a/hgext3rd/evolve/obsdiscovery.py Tue May 30 11:55:58 2017 +0200
+++ b/hgext3rd/evolve/obsdiscovery.py Tue May 30 12:13:14 2017 +0200
@@ -76,11 +76,17 @@
### trigger discovery during exchange ###
##########################################
+def _dopushmarkers(pushop):
+ return (# we have any markers to push
+ pushop.repo.obsstore
+ # exchange of obsmarkers is enabled locally
+ and obsolete.isenabled(pushop.repo, obsolete.exchangeopt)
+ # remote server accept markers
+ and 'obsolete' in pushop.remote.listkeys('namespaces'))
+
@eh.wrapfunction(exchange, '_pushdiscoveryobsmarkers')
def _pushdiscoveryobsmarkers(orig, pushop):
- if (obsolete.isenabled(pushop.repo, obsolete.exchangeopt)
- and pushop.repo.obsstore
- and 'obsolete' in pushop.remote.listkeys('namespaces')):
+ if _dopushmarkers(pushop):
repo = pushop.repo
obsexcmsg(repo.ui, "computing relevant nodes\n")
revs = list(repo.revs('::%ln', pushop.futureheads))