patch: extract fs access from patchfile into fsbackend
Most filesystem calls are already isolated in patchfile but this is not enough:
renames are performed before patchfile is available and some chmod calls are
even done outside of the applydiff call. Once all these calls are extracted
into a backend class, we can provide cleaner APIs to write to a working
directory context directly into the repository.
[ original upstream message ]
--- a/hgkw/keyword.py Mon May 16 21:56:26 2011 +0200
+++ b/hgkw/keyword.py Tue May 17 23:46:15 2011 +0200
@@ -595,11 +595,11 @@
wlock.release()
# monkeypatches
- def kwpatchfile_init(orig, self, ui, fname, opener,
+ def kwpatchfile_init(orig, self, ui, fname, backend,
missing=False, eolmode=None):
'''Monkeypatch/wrap patch.patchfile.__init__ to avoid
rejects or conflicts due to expanded keywords in working dir.'''
- orig(self, ui, fname, opener, missing, eolmode)
+ orig(self, ui, fname, backend, missing, eolmode)
# shrink keywords read from working dir
self.lines = kwt.shrinklines(self.fname, self.lines)