Fix handling no newline at EOF in both files
If both files have no newline at EOF, diff will notify us in the context, but that case wasn't handled by the parser. https://storyboard.openstack.org/#!/story/84 Change-Id: Ib2f1b4b4c9d8f38a983300e7026331754592705f
This commit is contained in:
parent
7f953ac970
commit
e5666d006b
@ -293,12 +293,16 @@ class Repo(object):
|
|||||||
rest = line[1:]
|
rest = line[1:]
|
||||||
if key == '\\':
|
if key == '\\':
|
||||||
# This is for "\ No newline at end of file" which
|
# This is for "\ No newline at end of file" which
|
||||||
# follows either a - or + line to indicate which
|
# follows either a -, + or ' ' line to indicate
|
||||||
# file it's talking about. For now, treat it like
|
# which file it's talking about (or both). For
|
||||||
# normal text and let the user infer from context
|
# now, treat it like normal text and let the user
|
||||||
# that it's not actually in the file. Potential
|
# infer from context that it's not actually in the
|
||||||
# TODO: highlight it to make that more clear.
|
# file. Potential TODO: highlight it to make that
|
||||||
key = prev_key
|
# more clear.
|
||||||
|
if prev_key:
|
||||||
|
key = prev_key
|
||||||
|
else:
|
||||||
|
key = ' '
|
||||||
prev_key = '\\'
|
prev_key = '\\'
|
||||||
if key == '-':
|
if key == '-':
|
||||||
prev_key = '-'
|
prev_key = '-'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user