Mercurial > public > mercurial-scm > hg-stable
diff mercurial/context.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 | 634b259079c5 |
children | bf2daeddd42b |
line wrap: on
line diff
--- a/mercurial/context.py Sun Jul 09 15:11:19 2017 +0200 +++ b/mercurial/context.py Fri Jul 07 11:51:10 2017 -0700 @@ -38,6 +38,7 @@ repoview, revlog, scmutil, + sparse, subrepo, util, ) @@ -1803,6 +1804,11 @@ match.bad = bad return match + def markcommitted(self, node): + super(workingctx, self).markcommitted(node) + + sparse.aftercommit(self._repo, node) + class committablefilectx(basefilectx): """A committablefilectx provides common functionality for a file context that wants the ability to commit, e.g. workingfilectx or memfilectx."""