# HG changeset patch # User Sean Farley # Date 1404327661 18000 # Node ID 0c48bc3d0eb22ba90366c6a4948e35cdeca692c0 # Parent 443ef664fb557b850e8ad21d647c992dd8f6f855 workingfilectx: add remove and write methods This patch will allow abstracting localrepo.remove / write method to refactor working directory code. diff -r 443ef664fb55 -r 0c48bc3d0eb2 mercurial/context.py --- 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().