Fix git parser assuming header presence and order.
Review Request #7263 — Created April 29, 2015 and submitted
The git diff format does not specify the order of extended headers or that certain headers must appear with others. We were assuming some ordering and header dependencies that while true in the git case are not true for git diffs generated by mercurial. We now parse all of the headers at once ignoring order and then act on them after the header parsing is complete. The GitDiffParser should now properly parse a mercurial generated git diff.
Unit tests pass, hg git diff parses.
Description | From | Last Updated |
---|---|---|
Assuming these aren't constants, they should be defined in __init__. |
chipx86 | |
]) on the next line, and trailing comma on the string, so it's easier to extend down the road. |
chipx86 | |
Let's pull self.lines[linenum] out into a local line variable, to avoid repeated lookups. |
chipx86 | |
Col: 9 E303 too many blank lines (2) |
reviewbot |
SM
- Change Summary:
-
Fixup based on feedback.
- Commit:
-
62449830e11f6f42da4082c5476edc0ef95ee49c2f713137793bbecf9d49119d5499404f0b831efd
-
Tool: PEP8 Style Checker Processed Files: reviewboard/diffviewer/parser.py reviewboard/scmtools/git.py Tool: Pyflakes Processed Files: reviewboard/diffviewer/parser.py reviewboard/scmtools/git.py
SM
- Change Summary:
-
rebased.
- Commit:
-
2f713137793bbecf9d49119d5499404f0b831efd0bcd91a15a1c4379350da53ecd4ff9d42205e144