##// END OF EJS Templates
exchange: introduce a '_canusebundle2' function...
Pierre-Yves David -
r24650:b83a8f51 default
parent child Browse files
Show More
@@ -52,6 +52,14 b' def buildobsmarkerspart(bundler, markers'
52 return bundler.newpart('b2x:obsmarkers', data=stream)
52 return bundler.newpart('b2x:obsmarkers', data=stream)
53 return None
53 return None
54
54
55 def _canusebundle2(op):
56 """return true if a pull/push can use bundle2
57
58 Feel free to nuke this function when we drop the experimental option"""
59 return (op.repo.ui.configbool('experimental', 'bundle2-exp', False)
60 and op.remote.capable('bundle2-exp'))
61
62
55 class pushoperation(object):
63 class pushoperation(object):
56 """A object that represent a single push operation
64 """A object that represent a single push operation
57
65
@@ -217,9 +225,7 b' def push(repo, remote, force=False, revs'
217 lock = pushop.remote.lock()
225 lock = pushop.remote.lock()
218 try:
226 try:
219 _pushdiscovery(pushop)
227 _pushdiscovery(pushop)
220 if (pushop.repo.ui.configbool('experimental', 'bundle2-exp',
228 if _canusebundle2(pushop):
221 False)
222 and pushop.remote.capable('bundle2-exp')):
223 _pushbundle2(pushop)
229 _pushbundle2(pushop)
224 _pushchangeset(pushop)
230 _pushchangeset(pushop)
225 _pushsyncphase(pushop)
231 _pushsyncphase(pushop)
@@ -876,8 +882,7 b' def pull(repo, remote, heads=None, force'
876 try:
882 try:
877 pullop.trmanager = transactionmanager(repo, 'pull', remote.url())
883 pullop.trmanager = transactionmanager(repo, 'pull', remote.url())
878 _pulldiscovery(pullop)
884 _pulldiscovery(pullop)
879 if (pullop.repo.ui.configbool('experimental', 'bundle2-exp', False)
885 if _canusebundle2(pullop):
880 and pullop.remote.capable('bundle2-exp')):
881 _pullbundle2(pullop)
886 _pullbundle2(pullop)
882 _pullchangeset(pullop)
887 _pullchangeset(pullop)
883 _pullphase(pullop)
888 _pullphase(pullop)
General Comments 0
You need to be logged in to leave comments. Login now