patch: generalize the use of patchmeta in applydiff() stable
authorPatrick Mezard <pmezard@gmail.com>
Sat, 11 Jun 2011 14:17:25 +0200
branchstable
changeset 964 aaafe06aaa5f
parent 962 b5a4f9f5ec49
child 965 d64b07980755
child 966 e6f112b6f14b
patch: generalize the use of patchmeta in applydiff() - Add patchmeta.copy() and emit copies from iterhunks. Modifying patchmeta instances in applydiff() makes things simpler. - Rename selectfile() into makepatchmeta(). It is responsible for creating patchmeta for regular patches. - Pass patchmeta objects to patchfile() directly patchmeta instances were associated with git patches, for regular patches we had to pass additional variables to tell the patch intent to patchfile(). Instead, we generate patchmeta for regular patches and pass them. This will also help with patch filtering by matcher objects. [ original upstream message ]
hgkw/keyword.py
--- a/hgkw/keyword.py	Tue May 31 20:39:04 2011 -0500
+++ b/hgkw/keyword.py	Sat Jun 11 14:17:25 2011 +0200
@@ -595,12 +595,10 @@
                 wlock.release()
 
     # monkeypatches
-    def kwpatchfile_init(orig, self, ui, fname, backend, store, mode, create,
-                         remove, eolmode=None, copysource=None):
+    def kwpatchfile_init(orig, self, ui, gp, backend, store, eolmode=None):
         '''Monkeypatch/wrap patch.patchfile.__init__ to avoid
         rejects or conflicts due to expanded keywords in working dir.'''
-        orig(self, ui, fname, backend, store, mode, create, remove,
-             eolmode, copysource)
+        orig(self, ui, gp, backend, store, eolmode)
         # shrink keywords read from working dir
         self.lines = kwt.shrinklines(self.fname, self.lines)