comparison mercurial/sparse.py @ 33353:160efb559f67

sparse: move post commit actions into core Instead of wrapping committablectx.markcommitted(), we inline the call into workingctx.markcommitted(). Per smf's review, workingctx is the proper location for this code, as committablectx is the shared base class for it and memctx. Since this code touches the working directory, it belongs in workingctx.
author Gregory Szorc <gregory.szorc@gmail.com>
date Fri, 07 Jul 2017 11:51:10 -0700
parents 38df146d0697
children 4695f1829045
comparison
equal deleted inserted replaced
33352:967ac37f3d45 33353:160efb559f67
476 for file in lookup: 476 for file in lookup:
477 # File exists on disk, and we're bringing it back in an unknown state. 477 # File exists on disk, and we're bringing it back in an unknown state.
478 dirstate.normallookup(file) 478 dirstate.normallookup(file)
479 479
480 return added, dropped, lookup 480 return added, dropped, lookup
481
482 def aftercommit(repo, node):
483 """Perform actions after a working directory commit."""
484 # This function is called unconditionally, even if sparse isn't
485 # enabled.
486 ctx = repo[node]
487
488 profiles = patternsforrev(repo, ctx.rev())[2]
489
490 # profiles will only have data if sparse is enabled.
491 if set(profiles) & set(ctx.files()):
492 origstatus = repo.status()
493 origsparsematch = matcher(repo)
494 refreshwdir(repo, origstatus, origsparsematch, force=True)
495
496 prunetemporaryincludes(repo)