Mercurial > public > mercurial-scm > hg
comparison mercurial/merge.py @ 34786:9c899660700a
merge: don't use workers in in-memory mode
The worker processes can't share memory, so workers should not be used.
Differential Revision: https://phab.mercurial-scm.org/D1105
author | Phil Cohen <phillco@fb.com> |
---|---|
date | Sun, 15 Oct 2017 20:36:29 -0700 |
parents | c0a524f77e8a |
children | 754b5117622f |
comparison
equal
deleted
inserted
replaced
34785:1af4561b6bfe | 34786:9c899660700a |
---|---|
1425 s(_("resolve manually then use 'hg resolve --mark %s'\n") % f) | 1425 s(_("resolve manually then use 'hg resolve --mark %s'\n") % f) |
1426 ms.addpath(f, f1, fo) | 1426 ms.addpath(f, f1, fo) |
1427 z += 1 | 1427 z += 1 |
1428 progress(_updating, z, item=f, total=numupdates, unit=_files) | 1428 progress(_updating, z, item=f, total=numupdates, unit=_files) |
1429 | 1429 |
1430 # When merging in-memory, we can't support worker processes, so set the | |
1431 # per-item cost at 0 in that case. | |
1432 cost = 0 if wctx.isinmemory() else 0.001 | |
1433 | |
1430 # remove in parallel (must come before resolving path conflicts and getting) | 1434 # remove in parallel (must come before resolving path conflicts and getting) |
1431 prog = worker.worker(repo.ui, 0.001, batchremove, (repo, wctx), | 1435 prog = worker.worker(repo.ui, cost, batchremove, (repo, wctx), |
1432 actions['r']) | 1436 actions['r']) |
1433 for i, item in prog: | 1437 for i, item in prog: |
1434 z += i | 1438 z += i |
1435 progress(_updating, z, item=item, total=numupdates, unit=_files) | 1439 progress(_updating, z, item=item, total=numupdates, unit=_files) |
1436 removed = len(actions['r']) | 1440 removed = len(actions['r']) |
1450 # We should flush before forking into worker processes, since those workers | 1454 # We should flush before forking into worker processes, since those workers |
1451 # flush when they complete, and we don't want to duplicate work. | 1455 # flush when they complete, and we don't want to duplicate work. |
1452 wctx.flushall() | 1456 wctx.flushall() |
1453 | 1457 |
1454 # get in parallel | 1458 # get in parallel |
1455 prog = worker.worker(repo.ui, 0.001, batchget, (repo, mctx, wctx), | 1459 prog = worker.worker(repo.ui, cost, batchget, (repo, mctx, wctx), |
1456 actions['g']) | 1460 actions['g']) |
1457 for i, item in prog: | 1461 for i, item in prog: |
1458 z += i | 1462 z += i |
1459 progress(_updating, z, item=item, total=numupdates, unit=_files) | 1463 progress(_updating, z, item=item, total=numupdates, unit=_files) |
1460 updated = len(actions['g']) | 1464 updated = len(actions['g']) |