diff --git a/mercurial/commit.py b/mercurial/commit.py --- a/mercurial/commit.py +++ b/mercurial/commit.py @@ -155,7 +155,7 @@ copy_sd = repo.filecopiesmode == b'changeset-sidedata' if copy_sd and len(ctx.parents()) > 1: if ms.active(): - for fname in sorted(ms._stateextras.keys()): + for fname in sorted(ms.allextras().keys()): might_removed = ms.extras(fname).get(b'merge-removal-candidate') if might_removed == b'yes': if fname in ctx: diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py --- a/mercurial/debugcommands.py +++ b/mercurial/debugcommands.py @@ -2107,7 +2107,7 @@ fm_files.end() fm_extras = fm.nested(b'extras') - for f, d in sorted(pycompat.iteritems(ms._stateextras)): + for f, d in sorted(pycompat.iteritems(ms.allextras())): if f in ms: # If file is in mergestate, we have already processed it's extras continue diff --git a/mercurial/mergestate.py b/mercurial/mergestate.py --- a/mercurial/mergestate.py +++ b/mercurial/mergestate.py @@ -306,7 +306,12 @@ ): yield f + def allextras(self): + """ return all extras information stored with the mergestate """ + return self._stateextras + def extras(self, filename): + """ return extras stored with the mergestate for the given filename """ return self._stateextras[filename] def _resolve(self, preresolve, dfile, wctx):