Index: mercurial/merge.py =================================================================== --- mercurial/merge.py +++ mercurial/merge.py @@ -646,6 +646,14 @@ return config def _checkunknownfile(repo, wctx, mctx, f, f2=None): + if wctx.isinmemory(): + # Nothing to do in IMM because nothing in the "working copy" can be an + # unknown file. + # + # Note that we should bail out here, not in ``_checkunknownfiles()``, + # because that function does other useful work. + return False + if f2 is None: f2 = f return (repo.wvfs.audit.check(f)