From patchwork Mon Sep 11 03:55:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D628: merge: flush any deferred writes before, and after, running any workers From: phabricator X-Patchwork-Id: 23760 Message-Id: <8f2d7976a20395efa018c0811ffebdc2@localhost.localdomain> To: mercurial-devel@mercurial-scm.org Date: Mon, 11 Sep 2017 03:55:29 +0000 phillco updated this revision to Diff 1701. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D628?vs=1672&id=1701 REVISION DETAIL https://phab.mercurial-scm.org/D628 AFFECTED FILES mercurial/merge.py CHANGE DETAILS To: phillco, #hg-reviewers Cc: quark, mercurial-devel diff --git a/mercurial/merge.py b/mercurial/merge.py --- a/mercurial/merge.py +++ b/mercurial/merge.py @@ -1111,6 +1111,10 @@ _warnifmissingcwd(repo, cwd) + # It's necessary to flush here in case we're inside a worker fork and will + # quit after this function. + wctx.flushall() + def batchget(repo, mctx, wctx, actions): """apply gets to the working directory @@ -1146,6 +1150,10 @@ if i > 0: yield i, f + # It's necessary to flush here in case we're inside a worker fork and will + # quit after this function. + wctx.flushall() + def applyupdates(repo, actions, wctx, mctx, overwrite, labels=None): """apply the merge action list to the working directory @@ -1214,6 +1222,10 @@ progress(_updating, z, item=item, total=numupdates, unit=_files) removed = len(actions['r']) + # We should flush before forking into worker processes, since those workers + # flush when they complete, and we don't want to duplicate work. + wctx.flushall() + # get in parallel prog = worker.worker(repo.ui, 0.001, batchget, (repo, mctx, wctx), actions['g'])