patch: extract fs access from patchfile into fsbackend stable
authorPatrick Mezard <pmezard@gmail.com>
Tue, 17 May 2011 23:46:15 +0200
branchstable
changeset 949 dd81191ffac3
parent 947 23f0eeb598b5
child 950 d93ca857e4bb
child 951 0af8a73dfe14
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 ]
hgkw/keyword.py
--- 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)