comparison hgext/evolve.py @ 1214:4b10e2c6f7e3

config: remove uses of obsolete._enabled Upstream Mercurial will be removing obsolete._enabled soon, so switch all our uses of it to use the new obsolete.isenabled(repo, option) function.
author Durham Goode <durham@fb.com>
date Tue, 17 Mar 2015 19:04:16 -0700
parents 7118996bdf43
children dd5e62979100
comparison
equal deleted inserted replaced
1213:7118996bdf43 1214:4b10e2c6f7e3
2306 ui.progress(topic, *args, **kwargs) 2306 ui.progress(topic, *args, **kwargs)
2307 2307
2308 if getattr(exchange, '_pushdiscoveryobsmarkers', None) is not None: 2308 if getattr(exchange, '_pushdiscoveryobsmarkers', None) is not None:
2309 @eh.wrapfunction(exchange, '_pushdiscoveryobsmarkers') 2309 @eh.wrapfunction(exchange, '_pushdiscoveryobsmarkers')
2310 def _pushdiscoveryobsmarkers(orig, pushop): 2310 def _pushdiscoveryobsmarkers(orig, pushop):
2311 if (obsolete._enabled 2311 if (obsolete.isenabled(pushop.repo, obsolete.exchangeopt)
2312 and pushop.repo.obsstore 2312 and pushop.repo.obsstore
2313 and 'obsolete' in pushop.remote.listkeys('namespaces')): 2313 and 'obsolete' in pushop.remote.listkeys('namespaces')):
2314 repo = pushop.repo 2314 repo = pushop.repo
2315 obsexcmsg(repo.ui, "computing relevant nodes\n") 2315 obsexcmsg(repo.ui, "computing relevant nodes\n")
2316 revs = list(repo.revs('::%ln', pushop.futureheads)) 2316 revs = list(repo.revs('::%ln', pushop.futureheads))
2348 2348
2349 @eh.wrapfunction(wireproto, 'capabilities') 2349 @eh.wrapfunction(wireproto, 'capabilities')
2350 def discocapabilities(orig, repo, proto): 2350 def discocapabilities(orig, repo, proto):
2351 """wrapper to advertise new capability""" 2351 """wrapper to advertise new capability"""
2352 caps = orig(repo, proto) 2352 caps = orig(repo, proto)
2353 if obsolete._enabled: 2353 if obsolete.isenabled(repo, obsolete.exchangeopt):
2354 caps += ' _evoext_obshash_0' 2354 caps += ' _evoext_obshash_0'
2355 return caps 2355 return caps
2356 2356
2357 @eh.extsetup 2357 @eh.extsetup
2358 def _installobsmarkersdiscovery(ui): 2358 def _installobsmarkersdiscovery(ui):
2483 pushop.ui.debug('try to push obsolete markers to remote\n') 2483 pushop.ui.debug('try to push obsolete markers to remote\n')
2484 repo = pushop.repo 2484 repo = pushop.repo
2485 remote = pushop.remote 2485 remote = pushop.remote
2486 unfi = repo.unfiltered() 2486 unfi = repo.unfiltered()
2487 cl = unfi.changelog 2487 cl = unfi.changelog
2488 if (obsolete._enabled and repo.obsstore and 2488 if (obsolete.isenabled(repo, obsolete.exchangeopt) and repo.obsstore and
2489 'obsolete' in remote.listkeys('namespaces')): 2489 'obsolete' in remote.listkeys('namespaces')):
2490 markers = pushop.outobsmarkers 2490 markers = pushop.outobsmarkers
2491 if not markers: 2491 if not markers:
2492 obsexcmsg(repo.ui, "no marker to push\n") 2492 obsexcmsg(repo.ui, "no marker to push\n")
2493 elif remote.capable('_evoext_pushobsmarkers_0'): 2493 elif remote.capable('_evoext_pushobsmarkers_0'):
2647 exchange.buildobsmarkerspart(bundler, markers) 2647 exchange.buildobsmarkerspart(bundler, markers)
2648 2648
2649 2649
2650 @eh.wrapfunction(exchange, '_pullobsolete') 2650 @eh.wrapfunction(exchange, '_pullobsolete')
2651 def _pullobsolete(orig, pullop): 2651 def _pullobsolete(orig, pullop):
2652 if not obsolete._enabled: 2652 if not obsolete.isenabled(pullop.repo, obsolete.exchangeopt):
2653 return None 2653 return None
2654 if 'obsmarkers' not in getattr(pullop, 'todosteps', ['obsmarkers']): 2654 if 'obsmarkers' not in getattr(pullop, 'todosteps', ['obsmarkers']):
2655 return None 2655 return None
2656 if 'obsmarkers' in getattr(pullop, 'stepsdone', []): 2656 if 'obsmarkers' in getattr(pullop, 'stepsdone', []):
2657 return None 2657 return None
2851 2851
2852 @eh.wrapfunction(wireproto, 'capabilities') 2852 @eh.wrapfunction(wireproto, 'capabilities')
2853 def capabilities(orig, repo, proto): 2853 def capabilities(orig, repo, proto):
2854 """wrapper to advertise new capability""" 2854 """wrapper to advertise new capability"""
2855 caps = orig(repo, proto) 2855 caps = orig(repo, proto)
2856 if obsolete._enabled: 2856 if obsolete.isenabled(repo, obsolete.exchangeopt):
2857 caps += ' _evoext_pushobsmarkers_0' 2857 caps += ' _evoext_pushobsmarkers_0'
2858 caps += ' _evoext_pullobsmarkers_0' 2858 caps += ' _evoext_pullobsmarkers_0'
2859 caps += ' _evoext_obshash_0' 2859 caps += ' _evoext_obshash_0'
2860 caps += ' _evoext_getbundle_obscommon' 2860 caps += ' _evoext_getbundle_obscommon'
2861 return caps 2861 return caps