Start of diff misdetected when message line starts with 'diff'

Stefan Hajnoczi stefanha at gmail.com
Sat Jan 14 01:01:01 EST 2012


The patch parser misdetects diffs because it does the following in
parser.py:parse_patch():

for line in text.split('\n'):
    line += '\n'

    if state == 0:
        if line.startswith('diff') or line.startswith('===') \
                or line.startswith('Index: '):

For a real-life example see http://patchwork.ozlabs.org/patch/135291/
where a line begins with the word "difficult".

I wanted to add a unit test and fix could not get the test suite to
run.  Is there documentation on how to run
apps/patchwork/tests/patchparser.py?

Stefan


More information about the Patchwork mailing list