##// END OF EJS Templates
bundle2-push: move changegroup push validation inside _pushb2ctx...
Pierre-Yves David -
r21903:48f61cfb default
parent child Browse files
Show More
@@ -131,15 +131,11 b' def push(repo, remote, force=False, revs'
131 lock = pushop.remote.lock()
131 lock = pushop.remote.lock()
132 try:
132 try:
133 _pushdiscovery(pushop)
133 _pushdiscovery(pushop)
134 if _pushcheckoutgoing(pushop):
134 if (pushop.repo.ui.configbool('experimental', 'bundle2-exp',
135 pushop.repo.prepushoutgoinghooks(pushop.repo,
135 False)
136 pushop.remote,
136 and pushop.remote.capable('bundle2-exp')):
137 pushop.outgoing)
137 _pushbundle2(pushop)
138 if (pushop.repo.ui.configbool('experimental', 'bundle2-exp',
138 _pushchangeset(pushop)
139 False)
140 and pushop.remote.capable('bundle2-exp')):
141 _pushbundle2(pushop)
142 _pushchangeset(pushop)
143 _pushcomputecommonheads(pushop)
139 _pushcomputecommonheads(pushop)
144 _pushsyncphase(pushop)
140 _pushsyncphase(pushop)
145 _pushobsolete(pushop)
141 _pushobsolete(pushop)
@@ -214,6 +210,12 b' def _pushb2ctx(pushop, bundler):'
214 return
210 return
215 pushop.stepsdone.add('changesets')
211 pushop.stepsdone.add('changesets')
216 # Send known heads to the server for race detection.
212 # Send known heads to the server for race detection.
213 pushop.stepsdone.add('changesets')
214 if not _pushcheckoutgoing(pushop):
215 return
216 pushop.repo.prepushoutgoinghooks(pushop.repo,
217 pushop.remote,
218 pushop.outgoing)
217 if not pushop.force:
219 if not pushop.force:
218 bundler.newpart('B2X:CHECK:HEADS', data=iter(pushop.remoteheads))
220 bundler.newpart('B2X:CHECK:HEADS', data=iter(pushop.remoteheads))
219 cg = changegroup.getlocalbundle(pushop.repo, 'push', pushop.outgoing)
221 cg = changegroup.getlocalbundle(pushop.repo, 'push', pushop.outgoing)
@@ -237,6 +239,9 b' def _pushbundle2(pushop):'
237 extrainfo = _pushbundle2extraparts(pushop, bundler)
239 extrainfo = _pushbundle2extraparts(pushop, bundler)
238 # add the changegroup bundle
240 # add the changegroup bundle
239 cgreplyhandler = _pushb2ctx(pushop, bundler)
241 cgreplyhandler = _pushb2ctx(pushop, bundler)
242 # do not push if no other parts than the capability
243 if bundler.nbparts <= 1:
244 return
240 stream = util.chunkbuffer(bundler.getchunks())
245 stream = util.chunkbuffer(bundler.getchunks())
241 try:
246 try:
242 reply = pushop.remote.unbundle(stream, ['force'], 'push')
247 reply = pushop.remote.unbundle(stream, ['force'], 'push')
@@ -268,6 +273,11 b' def _pushchangeset(pushop):'
268 if 'changesets' in pushop.stepsdone:
273 if 'changesets' in pushop.stepsdone:
269 return
274 return
270 pushop.stepsdone.add('changesets')
275 pushop.stepsdone.add('changesets')
276 if not _pushcheckoutgoing(pushop):
277 return
278 pushop.repo.prepushoutgoinghooks(pushop.repo,
279 pushop.remote,
280 pushop.outgoing)
271 outgoing = pushop.outgoing
281 outgoing = pushop.outgoing
272 unbundle = pushop.remote.capable('unbundle')
282 unbundle = pushop.remote.capable('unbundle')
273 # TODO: get bundlecaps from remote
283 # TODO: get bundlecaps from remote
General Comments 0
You need to be logged in to leave comments. Login now