Mercurial > public > mercurial-scm > hg
diff mercurial/merge.py @ 45499:19590b126764
merge: use in-memory mergestate when using in-memory context
This is my version of Augie's D8568. It makes it so we don't touch the
mergestate on disk when using an in-memory context.
The reason that I want this is not the same as the reason that Augie
write his patch (though I agree with that reason too). My hope is to
make in-memory rebase not fall back to on-disk rebase when there are
conflict. I plan to do that by adding a
`overlayworkingctx.reflect_in_workingcopy()`. The idea is that that
will update the working copy, the dirstate and the mergestate as
necessary.
Differential Revision: https://phab.mercurial-scm.org/D9040
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Tue, 15 Sep 2020 16:10:16 -0700 |
parents | 2c10876bb320 |
children | 32ce4cbaec4b |
line wrap: on
line diff
--- a/mercurial/merge.py Tue Sep 15 11:17:24 2020 -0700 +++ b/mercurial/merge.py Tue Sep 15 16:10:16 2020 -0700 @@ -1398,7 +1398,7 @@ _prefetchfiles(repo, mctx, mresult) updated, merged, removed = 0, 0, 0 - ms = mergestatemod.mergestate.clean(repo) + ms = wctx.mergestate(clean=True) ms.start(wctx.p1().node(), mctx.node(), labels) for f, op in pycompat.iteritems(mresult.commitinfo): @@ -1611,10 +1611,6 @@ usemergedriver = not overwrite and mergeactions and ms.mergedriver if usemergedriver: - if wctx.isinmemory(): - raise error.InMemoryMergeConflictsError( - b"in-memory merge does not support mergedriver" - ) ms.commit() proceed = driverpreprocess(repo, ms, wctx, labels=labels) # the driver might leave some files unresolved @@ -1895,7 +1891,7 @@ if not overwrite: if len(pl) > 1: raise error.Abort(_(b"outstanding uncommitted merge")) - ms = mergestatemod.mergestate.read(repo) + ms = wc.mergestate() if list(ms.unresolved()): raise error.Abort( _(b"outstanding merge conflicts"),