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