memfilectx: add remove and write methods
authorSean Farley <sean.michael.farley@gmail.com>
Fri, 25 Jul 2014 20:20:26 -0500
changeset 22074 fbe967b027bd
parent 22073 0c48bc3d0eb2
child 22075 2f0358275501
memfilectx: add remove and write methods Similar to the previous patch for workingfilectx, this patch will allow abstracting localrepo.remove / write method to refactor working directory code but instead operate on files in memory.
mercurial/context.py
--- a/mercurial/context.py	Wed Jul 02 14:01:01 2014 -0500
+++ b/mercurial/context.py	Fri Jul 25 20:20:26 2014 -0500
@@ -1684,3 +1684,12 @@
         return self._flags
     def renamed(self):
         return self._copied
+
+    def remove(self, ignoremissing=False):
+        """wraps unlink for a repo's working directory"""
+        # need to figure out what to do here
+        del self._changectx[self._path]
+
+    def write(self, data, flags):
+        """wraps repo.wwrite"""
+        self._data = data