Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/patch.py @ 10884:4fb1bafd43e7
Merge with stable
author | Brendan Cully <brendan@kublai.com> |
---|---|
date | Sun, 11 Apr 2010 20:59:55 -0700 |
parents | d14d45fae927 196908117c27 |
children | 13a1b2fb7ef2 |
comparison
equal
deleted
inserted
replaced
10882:f0bfe42c7b1f | 10884:4fb1bafd43e7 |
---|---|
45 '''return an iterator of individual patches from a stream''' | 45 '''return an iterator of individual patches from a stream''' |
46 def isheader(line, inheader): | 46 def isheader(line, inheader): |
47 if inheader and line[0] in (' ', '\t'): | 47 if inheader and line[0] in (' ', '\t'): |
48 # continuation | 48 # continuation |
49 return True | 49 return True |
50 if line[0] in (' ', '-', '+'): | |
51 # diff line - don't check for header pattern in there | |
52 return False | |
50 l = line.split(': ', 1) | 53 l = line.split(': ', 1) |
51 return len(l) == 2 and ' ' not in l[0] | 54 return len(l) == 2 and ' ' not in l[0] |
52 | 55 |
53 def chunk(lines): | 56 def chunk(lines): |
54 return cStringIO.StringIO(''.join(lines)) | 57 return cStringIO.StringIO(''.join(lines)) |