Mercurial > hg > evolve
changeset 1313:196c650d5ba9
pushexperiment: remove use of obsolete._enabled
pushexperiment.py was using obsolete._enabled but it didn't cause any tests to
fail so I didn't see it. Let's go ahead and replace it with the new
obsolete.isenabled() api.
author | Durham Goode <durham@fb.com> |
---|---|
date | Thu, 19 Mar 2015 17:42:21 -0700 |
parents | a307eea46f96 |
children | dd5e62979100 |
files | hgext/pushexperiment.py |
diffstat | 1 files changed, 4 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/pushexperiment.py +++ b/hgext/pushexperiment.py @@ -49,7 +49,8 @@ def syncpush(orig, repo, remote): """wraper for obsolete.syncpush to use the fast way if possible""" - if not (obsolete._enabled and repo.obsstore): + if not (obsolete.isenabled(repo, obsolete.exchangeopt) and + repo.obsstore): return if remote.capable('_push_experiment_pushobsmarkers_0'): return # already pushed before changeset @@ -75,7 +76,7 @@ """push wrapped that call the wire protocol command""" if not remote.canpush(): raise util.Abort(_("destination does not support push")) - if (obsolete._enabled and repo.obsstore + if (obsolete.isenabled(repo, obsolete.exchangeopt) and repo.obsstore and remote.capable('_push_experiment_pushobsmarkers_0')): # push marker early to limit damage of pushing too early. try: @@ -94,7 +95,7 @@ def capabilities(orig, repo, proto): """wrapper to advertise new capability""" caps = orig(repo, proto) - if obsolete._enabled: + if obsolete.isenabled(repo, obsolete.exchangeopt): caps += ' _push_experiment_pushobsmarkers_0' caps += ' _push_experiment_notifypushend_0' return caps