comparison mercurial/patch.py @ 15086:db0646afb725 stable

patch: handle 'gitpatches' being empty, but not none
author Dan Villiom Podlaski Christiansen <dan@cabo.dk>
date Sun, 11 Sep 2011 18:49:41 +0200
parents d60e4f227d75
children bfe903b1ff4e 7ce7177e029a
comparison
equal deleted inserted replaced
15084:deed405e8980 15086:db0646afb725
1197 yield 'hunk', h 1197 yield 'hunk', h
1198 elif x.startswith('diff --git'): 1198 elif x.startswith('diff --git'):
1199 m = gitre.match(x) 1199 m = gitre.match(x)
1200 if not m: 1200 if not m:
1201 continue 1201 continue
1202 if gitpatches is None: 1202 if not gitpatches:
1203 # scan whole input for git metadata 1203 # scan whole input for git metadata
1204 gitpatches = [('a/' + gp.path, 'b/' + gp.path, gp) for gp 1204 gitpatches = [('a/' + gp.path, 'b/' + gp.path, gp) for gp
1205 in scangitpatch(lr, x)] 1205 in scangitpatch(lr, x)]
1206 yield 'git', [g[2].copy() for g in gitpatches 1206 yield 'git', [g[2].copy() for g in gitpatches
1207 if g[2].op in ('COPY', 'RENAME')] 1207 if g[2].op in ('COPY', 'RENAME')]