# HG changeset patch # User Sean Farley # Date 1376516427 18000 # Node ID 9fbc193b23586a2bef51deaec37859524ccbb06a # Parent 8d4a8f4eb40412faeb2dfc76a82da491fcc0fe9f commitablectx: move markcommitted from workingctx diff -r 8d4a8f4eb404 -r 9fbc193b2358 mercurial/context.py --- 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()