~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/patches.py

  • Committer: Benoît Pierre
  • Date: 2008-11-30 00:28:29 UTC
  • mto: (4056.1.1 trunk2)
  • mto: This revision was merged to the branch mainline in revision 4058.
  • Revision ID: benoit.pierre@gmail.com-20081130002829-uamqrrhcytu5tzav
Fix handling of '\ No newline at end of file'.

Show diffs side-by-side

added added

removed removed

Lines of Context:
164
164
        return InsertLine(line[1:])
165
165
    elif line.startswith("-"):
166
166
        return RemoveLine(line[1:])
167
 
    elif line == NO_NL:
168
 
        return NO_NL
169
167
    else:
170
168
        raise MalformedLine("Unknown line type", line)
171
169
__pychecker__=""
240
238
def iter_hunks(iter_lines):
241
239
    hunk = None
242
240
    for line in iter_lines:
 
241
        if line == NO_NL and hunk is not None:
 
242
            hunk.lines.append(NO_NL)
 
243
            continue
243
244
        if line == "\n":
244
245
            if hunk is not None:
245
246
                yield hunk