Mercurial > hgsubversion
changeset 552:2d44461e8617
fix filterhunks for both crew and 1.4
author | Dirkjan Ochtman <dirkjan@ochtman.nl> |
---|---|
date | Sat, 06 Feb 2010 20:19:41 +0100 |
parents | d17cec76e769 |
children | 97f2079e3778 |
files | hgsubversion/stupid.py |
diffstat | 1 files changed, 6 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/hgsubversion/stupid.py +++ b/hgsubversion/stupid.py @@ -79,11 +79,15 @@ def mempatchproxy(parentctx, files): def filteriterhunks(meta): iterhunks = patch.iterhunks - def filterhunks(ui, fp, sourcefile=None): + def filterhunks(ui, fp, sourcefile=None, textmode=False): applycurrent = False # Passing False instead of textmode because we should never # be ignoring EOL type. - for data in iterhunks(ui, fp, sourcefile): + if len(iterhunks.func_defaults) == 1: + gen = iterhunks(ui, fp, sourcefile) + else: + gen = iterhunks(ui, fp, sourcefile, textmode) + for data in gen: if data[0] == 'file': if data[1][1] in meta.filemap: applycurrent = True