commitablectx: move markcommitted from workingctx
authorSean Farley <sean.michael.farley@gmail.com>
Wed, 14 Aug 2013 16:40:27 -0500
changeset 19699 9fbc193b2358
parent 19698 8d4a8f4eb404
child 19700 8f48f5969b47
commitablectx: move markcommitted from workingctx
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()