diff -r 376395868b7b -r c166b212bdee mercurial/shelve.py --- a/mercurial/shelve.py Tue Dec 13 10:00:04 2022 +0100 +++ b/mercurial/shelve.py Wed Jan 25 18:46:20 2023 +0100 @@ -637,7 +637,7 @@ ui.status(_(b'shelved as %s\n') % name) if opts[b'keep']: - with repo.dirstate.parentchange(): + with repo.dirstate.parentchange(repo): scmutil.movedirstate(repo, parent, match) else: hg.update(repo, parent.node()) @@ -862,14 +862,14 @@ shelvectx = repo[state.parents[1]] pendingctx = state.pendingctx - with repo.dirstate.parentchange(): + with repo.dirstate.parentchange(repo): repo.setparents(state.pendingctx.node(), repo.nullid) repo.dirstate.write(repo.currenttransaction()) targetphase = _target_phase(repo) overrides = {(b'phases', b'new-commit'): targetphase} with repo.ui.configoverride(overrides, b'unshelve'): - with repo.dirstate.parentchange(): + with repo.dirstate.parentchange(repo): repo.setparents(state.parents[0], repo.nullid) newnode, ispartialunshelve = _createunshelvectx( ui, repo, shelvectx, basename, interactive, opts @@ -1068,7 +1068,7 @@ ) raise error.ConflictResolutionRequired(b'unshelve') - with repo.dirstate.parentchange(): + with repo.dirstate.parentchange(repo): repo.setparents(tmpwctx.node(), repo.nullid) newnode, ispartialunshelve = _createunshelvectx( ui, repo, shelvectx, basename, interactive, opts