changeset 22074:fbe967b027bd

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.
author Sean Farley <sean.michael.farley@gmail.com>
date Fri, 25 Jul 2014 20:20:26 -0500
parents 0c48bc3d0eb2
children 2f0358275501
files mercurial/context.py
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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