# HG changeset patch # User Dirkjan Ochtman # Date 1265483981 -3600 # Node ID 2d44461e86170ea400d06eddb3c5dd68fba08da9 # Parent d17cec76e769f267edde754f880c3bec417688a3 fix filterhunks for both crew and 1.4 diff --git a/hgsubversion/stupid.py b/hgsubversion/stupid.py --- 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