comparison mercurial/commands.py @ 49961:7a8bfc05b691

dirstate: rename parentchange to changing_parents Since the new argument breaks the API anyway, we can rename it to a better name. The previous name `parentchange` might be seen as something active, a function that would directly change the parents, however this is just a context manager to frame the operation that will change the parents and adjust the dirstate content accordingly. In addition, the future sister method that will be about changes to tracking and files would have a hard time fitting in the same naming scheme in a clear way. The new naming uses a clear prefix will make it more distinct from other dirstate methods and easier to extend with other similar contexts.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 25 Jan 2023 19:12:31 +0100
parents c166b212bdee
children 3c34a224c232
comparison
equal deleted inserted replaced
49960:c166b212bdee 49961:7a8bfc05b691
6262 # - we are sure we store that information well enough to be able to reuse it 6262 # - we are sure we store that information well enough to be able to reuse it
6263 # - we are the necessary logic to reuse it right. 6263 # - we are the necessary logic to reuse it right.
6264 # 6264 #
6265 # All this should eventually happens, but in the mean time, we use this 6265 # All this should eventually happens, but in the mean time, we use this
6266 # context manager slightly out of the context it should be. 6266 # context manager slightly out of the context it should be.
6267 with repo.dirstate.parentchange(repo): 6267 with repo.dirstate.changing_parents(repo):
6268 mergestatemod.recordupdates(repo, ms.actions(), branchmerge, None) 6268 mergestatemod.recordupdates(repo, ms.actions(), branchmerge, None)
6269 6269
6270 if not didwork and pats: 6270 if not didwork and pats:
6271 hint = None 6271 hint = None
6272 if not any([p for p in pats if p.find(b':') >= 0]): 6272 if not any([p for p in pats if p.find(b':') >= 0]):