comparison mercurial/merge.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 c7a04bfabd4d
children 7a8bfc05b691
comparison
equal deleted inserted replaced
49959:376395868b7b 49960:c166b212bdee
2153 getfiledata[a[0]] = None 2153 getfiledata[a[0]] = None
2154 2154
2155 assert len(getfiledata) == ( 2155 assert len(getfiledata) == (
2156 mresult.len((mergestatemod.ACTION_GET,)) if wantfiledata else 0 2156 mresult.len((mergestatemod.ACTION_GET,)) if wantfiledata else 0
2157 ) 2157 )
2158 with repo.dirstate.parentchange(): 2158 with repo.dirstate.parentchange(repo):
2159 ### Filter Filedata 2159 ### Filter Filedata
2160 # 2160 #
2161 # We gathered "cache" information for the clean file while 2161 # We gathered "cache" information for the clean file while
2162 # updating them: mtime, size and mode. 2162 # updating them: mtime, size and mode.
2163 # 2163 #
2375 if wctx.isinmemory(): 2375 if wctx.isinmemory():
2376 wctx.setparents(pctx.node(), pother) 2376 wctx.setparents(pctx.node(), pother)
2377 # fix up dirstate for copies and renames 2377 # fix up dirstate for copies and renames
2378 copies.graftcopies(wctx, ctx, base) 2378 copies.graftcopies(wctx, ctx, base)
2379 else: 2379 else:
2380 with repo.dirstate.parentchange(): 2380 with repo.dirstate.parentchange(repo):
2381 repo.setparents(pctx.node(), pother) 2381 repo.setparents(pctx.node(), pother)
2382 repo.dirstate.write(repo.currenttransaction()) 2382 repo.dirstate.write(repo.currenttransaction())
2383 # fix up dirstate for copies and renames 2383 # fix up dirstate for copies and renames
2384 copies.graftcopies(wctx, ctx, base) 2384 copies.graftcopies(wctx, ctx, base)
2385 return stats 2385 return stats