Mercurial > public > mercurial-scm > hg
diff mercurial/cmdutil.py @ 49960:c166b212bdee
dirstate: pass the repo to the `changeparent` method
If we want the context to be responsible for writing (and we want it), we need
to have access to a localrepository object.
So we now requires a localrepository object as an argument to this context
manager.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Wed, 25 Jan 2023 18:46:20 +0100 |
parents | e78a41686464 |
children | 7a8bfc05b691 |
line wrap: on
line diff
--- a/mercurial/cmdutil.py Tue Dec 13 10:00:04 2022 +0100 +++ b/mercurial/cmdutil.py Wed Jan 25 18:46:20 2023 +0100 @@ -638,7 +638,7 @@ # already called within a `pendingchange`, However we # are taking a shortcut here in order to be able to # quickly deprecated the older API. - with dirstate.parentchange(): + with dirstate.parentchange(repo): dirstate.update_file( realname, p1_tracked=True, @@ -1532,7 +1532,7 @@ new_node = mem_ctx.commit() if repo.dirstate.p1() == ctx.node(): - with repo.dirstate.parentchange(): + with repo.dirstate.parentchange(repo): scmutil.movedirstate(repo, repo[new_node]) replacements = {ctx.node(): [new_node]} scmutil.cleanupnodes( @@ -1625,7 +1625,7 @@ new_node = mem_ctx.commit() if repo.dirstate.p1() == ctx.node(): - with repo.dirstate.parentchange(): + with repo.dirstate.parentchange(repo): scmutil.movedirstate(repo, repo[new_node]) replacements = {ctx.node(): [new_node]} scmutil.cleanupnodes(repo, replacements, b'copy', fixphase=True) @@ -3024,7 +3024,7 @@ newid = repo.commitctx(new) ms.reset() - with repo.dirstate.parentchange(): + with repo.dirstate.parentchange(repo): # Reroute the working copy parent to the new changeset repo.setparents(newid, repo.nullid)