comparison hgext/largefiles/lfutil.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 0cf4c1b80fd9
comparison
equal deleted inserted replaced
49960:c166b212bdee 49961:7a8bfc05b691
229 ) 229 )
230 230
231 if len(standins) > 0: 231 if len(standins) > 0:
232 vfs.makedirs(lfstoredir) 232 vfs.makedirs(lfstoredir)
233 233
234 with lfdirstate.parentchange(repo): 234 with lfdirstate.changing_parents(repo):
235 for standin in standins: 235 for standin in standins:
236 lfile = splitstandin(standin) 236 lfile = splitstandin(standin)
237 lfdirstate.update_file( 237 lfdirstate.update_file(
238 lfile, p1_tracked=True, wc_tracked=True, possibly_dirty=True 238 lfile, p1_tracked=True, wc_tracked=True, possibly_dirty=True
239 ) 239 )
579 579
580 def markcommitted(orig, ctx, node): 580 def markcommitted(orig, ctx, node):
581 repo = ctx.repo() 581 repo = ctx.repo()
582 582
583 lfdirstate = openlfdirstate(repo.ui, repo) 583 lfdirstate = openlfdirstate(repo.ui, repo)
584 with lfdirstate.parentchange(repo): 584 with lfdirstate.changing_parents(repo):
585 orig(node) 585 orig(node)
586 586
587 # ATTENTION: "ctx.files()" may differ from "repo[node].files()" 587 # ATTENTION: "ctx.files()" may differ from "repo[node].files()"
588 # because files coming from the 2nd parent are omitted in the latter. 588 # because files coming from the 2nd parent are omitted in the latter.
589 # 589 #