Mercurial > public > mercurial-scm > hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
33352:967ac37f3d45 | 33353:160efb559f67 |
---|---|
36 phases, | 36 phases, |
37 pycompat, | 37 pycompat, |
38 repoview, | 38 repoview, |
39 revlog, | 39 revlog, |
40 scmutil, | 40 scmutil, |
41 sparse, | |
41 subrepo, | 42 subrepo, |
42 util, | 43 util, |
43 ) | 44 ) |
44 | 45 |
45 propertycache = util.propertycache | 46 propertycache = util.propertycache |
1801 self._repo.ui.warn('%s: %s\n' % | 1802 self._repo.ui.warn('%s: %s\n' % |
1802 (self._repo.dirstate.pathto(f), msg)) | 1803 (self._repo.dirstate.pathto(f), msg)) |
1803 match.bad = bad | 1804 match.bad = bad |
1804 return match | 1805 return match |
1805 | 1806 |
1807 def markcommitted(self, node): | |
1808 super(workingctx, self).markcommitted(node) | |
1809 | |
1810 sparse.aftercommit(self._repo, node) | |
1811 | |
1806 class committablefilectx(basefilectx): | 1812 class committablefilectx(basefilectx): |
1807 """A committablefilectx provides common functionality for a file context | 1813 """A committablefilectx provides common functionality for a file context |
1808 that wants the ability to commit, e.g. workingfilectx or memfilectx.""" | 1814 that wants the ability to commit, e.g. workingfilectx or memfilectx.""" |
1809 def __init__(self, repo, path, filelog=None, ctx=None): | 1815 def __init__(self, repo, path, filelog=None, ctx=None): |
1810 self._repo = repo | 1816 self._repo = repo |