workingfilectx: add remove and write methods
This patch will allow abstracting localrepo.remove / write method to refactor
working directory code.
--- a/mercurial/context.py Fri Jul 25 19:36:01 2014 -0500
+++ b/mercurial/context.py Wed Jul 02 14:01:01 2014 -0500
@@ -1556,6 +1556,14 @@
# invert comparison to reuse the same code path
return fctx.cmp(self)
+ def remove(self, ignoremissing=False):
+ """wraps unlink for a repo's working directory"""
+ util.unlinkpath(self._repo.wjoin(self._path), ignoremissing)
+
+ def write(self, data, flags):
+ """wraps repo.wwrite"""
+ self._repo.wwrite(self._path, data, flags)
+
class memctx(committablectx):
"""Use memctx to perform in-memory commits via localrepo.commitctx().