|
@@ -377,7 +377,11 @@ class Udiff(Diff):
|
377
|
377
|
return line.startswith('+++ ')
|
378
|
378
|
|
379
|
379
|
def is_hunk_meta(self, line):
|
380
|
|
- return line.startswith('@@ -') or line.startswith('## -')
|
|
380
|
+ """Minimal valid hunk meta is like '@@ -1 +1 @@', note extra chars might
|
|
381
|
+ occur after the ending @@, e.g. in git log
|
|
382
|
+ """
|
|
383
|
+ return (line.startswith('@@ -') and line.find(' @@') >= 8) or \
|
|
384
|
+ (line.startswith('## -') and line.find(' ##') >= 8)
|
381
|
385
|
|
382
|
386
|
def parse_hunk_meta(self, hunk_meta):
|
383
|
387
|
|
|
@@ -401,9 +405,11 @@ class Udiff(Diff):
|
401
|
405
|
return (line[0], line[1:])
|
402
|
406
|
|
403
|
407
|
def is_old(self, line):
|
404
|
|
- """Exclude header line from svn log --diff output"""
|
|
408
|
+ """Exclude old path and header line from svn log --diff output, allow
|
|
409
|
+ '----' likely to see in diff from yaml file
|
|
410
|
+ """
|
405
|
411
|
return line.startswith('-') and not self.is_old_path(line) and \
|
406
|
|
- not re.match(r'^-{4,}$', line.rstrip())
|
|
412
|
+ not re.match(r'^-{5,}$', line.rstrip())
|
407
|
413
|
|
408
|
414
|
def is_new(self, line):
|
409
|
415
|
return line.startswith('+') and not self.is_new_path(line)
|
|
@@ -496,6 +502,7 @@ class DiffParser(object):
|
496
|
502
|
line = decode(line)
|
497
|
503
|
|
498
|
504
|
if difflet.is_old_path(line):
|
|
505
|
+
|
499
|
506
|
if diff._old_path and diff._new_path and len(diff._hunks) > 0:
|
500
|
507
|
|
501
|
508
|
yield diff
|