Show More
@@ -278,42 +278,22 b' def _widen(ui, repo, remote, commoninc, ' | |||
|
278 | 278 | # silence the devel-warning of applying an empty changegroup |
|
279 | 279 | overrides = {('devel', 'all-warnings'): False} |
|
280 | 280 | |
|
281 | common = commoninc[0] | |
|
281 | 282 | with ui.uninterruptible(): |
|
282 | common = commoninc[0] | |
|
283 | 283 | if ellipsesremote: |
|
284 | 284 | ds = repo.dirstate |
|
285 | 285 | p1, p2 = ds.p1(), ds.p2() |
|
286 | 286 | with ds.parentchange(): |
|
287 | 287 | ds.setparents(node.nullid, node.nullid) |
|
288 | if isoldellipses: | |
|
288 | 289 | with wrappedextraprepare: |
|
289 | if isoldellipses: | |
|
290 | exchange.pull(repo, remote, heads=common) | |
|
291 | else: | |
|
292 | known = [node.hex(ctx.node()) for ctx in | |
|
293 | repo.set('::%ln', common) | |
|
294 | if ctx.node() != node.nullid] | |
|
295 | ||
|
296 | with remote.commandexecutor() as e: | |
|
297 | bundle = e.callcommand('narrow_widen', { | |
|
298 | 'oldincludes': oldincludes, | |
|
299 | 'oldexcludes': oldexcludes, | |
|
300 | 'newincludes': newincludes, | |
|
301 | 'newexcludes': newexcludes, | |
|
302 | 'cgversion': '03', | |
|
303 | 'commonheads': common, | |
|
304 | 'known': known, | |
|
305 | 'ellipses': True, | |
|
306 | }).result() | |
|
307 | trmanager = exchange.transactionmanager(repo, 'widen', | |
|
308 | remote.url()) | |
|
309 | with trmanager: | |
|
310 | op = bundle2.bundleoperation(repo, | |
|
311 | trmanager.transaction, source='widen') | |
|
312 | bundle2.processbundle(repo, bundle, op=op) | |
|
313 | ||
|
314 | with ds.parentchange(): | |
|
315 | ds.setparents(p1, p2) | |
|
290 | exchange.pull(repo, remote, heads=common) | |
|
316 | 291 | else: |
|
292 | known = [] | |
|
293 | if ellipsesremote: | |
|
294 | known = [node.hex(ctx.node()) for ctx in | |
|
295 | repo.set('::%ln', common) | |
|
296 | if ctx.node() != node.nullid] | |
|
317 | 297 | with remote.commandexecutor() as e: |
|
318 | 298 | bundle = e.callcommand('narrow_widen', { |
|
319 | 299 | 'oldincludes': oldincludes, |
@@ -322,15 +302,20 b' def _widen(ui, repo, remote, commoninc, ' | |||
|
322 | 302 | 'newexcludes': newexcludes, |
|
323 | 303 | 'cgversion': '03', |
|
324 | 304 | 'commonheads': common, |
|
325 |
'known': |
|
|
326 |
'ellipses': |
|
|
305 | 'known': known, | |
|
306 | 'ellipses': ellipsesremote, | |
|
327 | 307 | }).result() |
|
328 | 308 | |
|
329 | with repo.transaction('widening') as tr: | |
|
330 |
|
|
|
331 | tgetter = lambda: tr | |
|
332 | bundle2.processbundle(repo, bundle, | |
|
333 | transactiongetter=tgetter) | |
|
309 | trmanager = exchange.transactionmanager(repo, 'widen', remote.url()) | |
|
310 | with trmanager, repo.ui.configoverride(overrides, 'widen'): | |
|
311 | op = bundle2.bundleoperation(repo, trmanager.transaction, | |
|
312 | source='widen') | |
|
313 | # TODO: we should catch error.Abort here | |
|
314 | bundle2.processbundle(repo, bundle, op=op) | |
|
315 | ||
|
316 | if ellipsesremote: | |
|
317 | with ds.parentchange(): | |
|
318 | ds.setparents(p1, p2) | |
|
334 | 319 | |
|
335 | 320 | with repo.transaction('widening'): |
|
336 | 321 | repo.setnewnarrowpats() |
General Comments 0
You need to be logged in to leave comments.
Login now