##// 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 def push(repo, remote, force=False, revs
131 131 lock = pushop.remote.lock()
132 132 try:
133 133 _pushdiscovery(pushop)
134 if _pushcheckoutgoing(pushop):
135 pushop.repo.prepushoutgoinghooks(pushop.repo,
136 pushop.remote,
137 pushop.outgoing)
138 if (pushop.repo.ui.configbool('experimental', 'bundle2-exp',
139 False)
140 and pushop.remote.capable('bundle2-exp')):
141 _pushbundle2(pushop)
142 _pushchangeset(pushop)
134 if (pushop.repo.ui.configbool('experimental', 'bundle2-exp',
135 False)
136 and pushop.remote.capable('bundle2-exp')):
137 _pushbundle2(pushop)
138 _pushchangeset(pushop)
143 139 _pushcomputecommonheads(pushop)
144 140 _pushsyncphase(pushop)
145 141 _pushobsolete(pushop)
@@ -214,6 +210,12 def _pushb2ctx(pushop, bundler):
214 210 return
215 211 pushop.stepsdone.add('changesets')
216 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 219 if not pushop.force:
218 220 bundler.newpart('B2X:CHECK:HEADS', data=iter(pushop.remoteheads))
219 221 cg = changegroup.getlocalbundle(pushop.repo, 'push', pushop.outgoing)
@@ -237,6 +239,9 def _pushbundle2(pushop):
237 239 extrainfo = _pushbundle2extraparts(pushop, bundler)
238 240 # add the changegroup bundle
239 241 cgreplyhandler = _pushb2ctx(pushop, bundler)
242 # do not push if no other parts than the capability
243 if bundler.nbparts <= 1:
244 return
240 245 stream = util.chunkbuffer(bundler.getchunks())
241 246 try:
242 247 reply = pushop.remote.unbundle(stream, ['force'], 'push')
@@ -268,6 +273,11 def _pushchangeset(pushop):
268 273 if 'changesets' in pushop.stepsdone:
269 274 return
270 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 281 outgoing = pushop.outgoing
272 282 unbundle = pushop.remote.capable('unbundle')
273 283 # TODO: get bundlecaps from remote
General Comments 0
You need to be logged in to leave comments. Login now