Patchwork D1105: merge: don't use workers in in-memory mode

login
register
mail settings
Submitter phabricator
Date Oct. 17, 2017, 1:47 a.m.
Message ID <183cf0d60f5a2ad2fb9f362a3c908ea2@localhost.localdomain>
Download mbox | patch
Permalink /patch/25053/
State Not Applicable
Headers show

Comments

phabricator - Oct. 17, 2017, 1:47 a.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG8ff80d1c75b5: merge: don&#039;t use workers in in-memory mode (authored by phillco, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1105?vs=2797&id=2866

REVISION DETAIL
  https://phab.mercurial-scm.org/D1105

AFFECTED FILES
  mercurial/merge.py

CHANGE DETAILS




To: phillco, #hg-reviewers, durin42
Cc: mercurial-devel

Patch

diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -1427,8 +1427,12 @@ 
         z += 1
         progress(_updating, z, item=f, total=numupdates, unit=_files)
 
+    # When merging in-memory, we can't support worker processes, so set the
+    # per-item cost at 0 in that case.
+    cost = 0 if wctx.isinmemory() else 0.001
+
     # remove in parallel (must come before resolving path conflicts and getting)
-    prog = worker.worker(repo.ui, 0.001, batchremove, (repo, wctx),
+    prog = worker.worker(repo.ui, cost, batchremove, (repo, wctx),
                          actions['r'])
     for i, item in prog:
         z += i
@@ -1452,7 +1456,7 @@ 
     wctx.flushall()
 
     # get in parallel
-    prog = worker.worker(repo.ui, 0.001, batchget, (repo, mctx, wctx),
+    prog = worker.worker(repo.ui, cost, batchget, (repo, mctx, wctx),
                          actions['g'])
     for i, item in prog:
         z += i