Mercurial > hg
changeset 19699:9fbc193b2358
commitablectx: move markcommitted from workingctx
author | Sean Farley <sean.michael.farley@gmail.com> |
---|---|
date | Wed, 14 Aug 2013 16:40:27 -0500 |
parents | 8d4a8f4eb404 |
children | 8f48f5969b47 |
files | mercurial/context.py |
diffstat | 1 files changed, 16 insertions(+), 16 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/context.py Wed Aug 14 16:37:59 2013 -0500 +++ b/mercurial/context.py Wed Aug 14 16:40:27 2013 -0500 @@ -1043,6 +1043,22 @@ [p.rev() for p in self._parents]): yield changectx(self._repo, a) + def markcommitted(self, node): + """Perform post-commit cleanup necessary after committing this ctx + + Specifically, this updates backing stores this working context + wraps to reflect the fact that the changes reflected by this + workingctx have been committed. For example, it marks + modified and added files as normal in the dirstate. + + """ + + for f in self.modified() + self.added(): + self._repo.dirstate.normal(f) + for f in self.removed(): + self._repo.dirstate.drop(f) + self._repo.dirstate.setparents(node) + class workingctx(commitablectx): """A workingctx object makes access to data related to the current working directory convenient. @@ -1169,22 +1185,6 @@ finally: wlock.release() - def markcommitted(self, node): - """Perform post-commit cleanup necessary after committing this ctx - - Specifically, this updates backing stores this working context - wraps to reflect the fact that the changes reflected by this - workingctx have been committed. For example, it marks - modified and added files as normal in the dirstate. - - """ - - for f in self.modified() + self.added(): - self._repo.dirstate.normal(f) - for f in self.removed(): - self._repo.dirstate.drop(f) - self._repo.dirstate.setparents(node) - def dirs(self): return self._repo.dirstate.dirs()