diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -2474,7 +2474,7 @@ ui.status( _(b'working directory now based on revision %d\n') % parents ) - mergestatemod.mergestate.clean(self, self[b'.'].node()) + self[None].mergestate(clean=True) # TODO: if we know which new heads may result from this rollback, pass # them to destroy(), which will prevent the branchhead cache from being @@ -2775,6 +2775,7 @@ def _filecommit( self, + ctx, fctx, manifest1, manifest2, @@ -2873,7 +2874,7 @@ fparent2 = nullid elif not fparentancestors: # TODO: this whole if-else might be simplified much more - ms = mergestatemod.mergestate.read(self) + ms = ctx.mergestate() if ( fname in ms and ms[fname] == mergestatemod.MERGE_RECORD_MERGED_OTHER @@ -2974,7 +2975,7 @@ self, status, text, user, date, extra ) - ms = mergestatemod.mergestate.read(self) + ms = wctx.mergestate() mergeutil.checkunresolved(ms) # internal config: ui.allowemptycommit @@ -3123,6 +3124,7 @@ else: added.append(f) m[f] = self._filecommit( + ctx, fctx, m1, m2, diff --git a/tests/test-annotate.t b/tests/test-annotate.t --- a/tests/test-annotate.t +++ b/tests/test-annotate.t @@ -482,7 +482,7 @@ > from mercurial import error, node > def reposetup(ui, repo): > class legacyrepo(repo.__class__): - > def _filecommit(self, fctx, manifest1, manifest2, + > def _filecommit(self, ctx, fctx, manifest1, manifest2, > linkrev, tr, changelist, includecopymeta): > fname = fctx.path() > text = fctx.data() diff --git a/tests/test-fastannotate-hg.t b/tests/test-fastannotate-hg.t --- a/tests/test-fastannotate-hg.t +++ b/tests/test-fastannotate-hg.t @@ -484,7 +484,7 @@ > from mercurial import error, node > def reposetup(ui, repo): > class legacyrepo(repo.__class__): - > def _filecommit(self, fctx, manifest1, manifest2, + > def _filecommit(self, ctx, fctx, manifest1, manifest2, > linkrev, tr, changelist, includecopymeta): > fname = fctx.path() > text = fctx.data()