Mercurial > hg
comparison hgext/keyword.py @ 14566:d0c2cc11e611
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.
author | Patrick Mezard <pmezard@gmail.com> |
---|---|
date | Sat, 11 Jun 2011 14:17:25 +0200 |
parents | ee574cfd0c32 |
children | 35c2cc322ba8 |
comparison
equal
deleted
inserted
replaced
14565:3cacc232f27f | 14566:d0c2cc11e611 |
---|---|
593 return ret | 593 return ret |
594 finally: | 594 finally: |
595 wlock.release() | 595 wlock.release() |
596 | 596 |
597 # monkeypatches | 597 # monkeypatches |
598 def kwpatchfile_init(orig, self, ui, fname, backend, store, mode, create, | 598 def kwpatchfile_init(orig, self, ui, gp, backend, store, eolmode=None): |
599 remove, eolmode=None, copysource=None): | |
600 '''Monkeypatch/wrap patch.patchfile.__init__ to avoid | 599 '''Monkeypatch/wrap patch.patchfile.__init__ to avoid |
601 rejects or conflicts due to expanded keywords in working dir.''' | 600 rejects or conflicts due to expanded keywords in working dir.''' |
602 orig(self, ui, fname, backend, store, mode, create, remove, | 601 orig(self, ui, gp, backend, store, eolmode) |
603 eolmode, copysource) | |
604 # shrink keywords read from working dir | 602 # shrink keywords read from working dir |
605 self.lines = kwt.shrinklines(self.fname, self.lines) | 603 self.lines = kwt.shrinklines(self.fname, self.lines) |
606 | 604 |
607 def kw_diff(orig, repo, node1=None, node2=None, match=None, changes=None, | 605 def kw_diff(orig, repo, node1=None, node2=None, match=None, changes=None, |
608 opts=None, prefix=''): | 606 opts=None, prefix=''): |