comparison hgext/split.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 6000f5b25c9b
children 7a8bfc05b691
comparison
equal deleted inserted replaced
49959:376395868b7b 49960:c166b212bdee
132 committed = [] # [ctx] 132 committed = [] # [ctx]
133 133
134 # Set working parent to ctx.p1(), and keep working copy as ctx's content 134 # Set working parent to ctx.p1(), and keep working copy as ctx's content
135 if ctx.node() != repo.dirstate.p1(): 135 if ctx.node() != repo.dirstate.p1():
136 hg.clean(repo, ctx.node(), show_stats=False) 136 hg.clean(repo, ctx.node(), show_stats=False)
137 with repo.dirstate.parentchange(): 137 with repo.dirstate.parentchange(repo):
138 scmutil.movedirstate(repo, ctx.p1()) 138 scmutil.movedirstate(repo, ctx.p1())
139 139
140 # Any modified, added, removed, deleted result means split is incomplete 140 # Any modified, added, removed, deleted result means split is incomplete
141 def incomplete(repo): 141 def incomplete(repo):
142 st = repo.status() 142 st = repo.status()