Addressing TODO for faster algorithm to convert from file line numbers to filediff line numbers
Review Request #3980 — Created March 20, 2013 and discarded
Added a function _locate_line() that does a binary search for the chunk that contains the line to be searched and then follows up with another binary search within the chunk to get to the line itself. The function returns the chunk and the row which contains the line number.
Tested by running ReviewBot (cpplint, pep8 -- on 1 Cpp file and 1 python script) with the changes and the comments were updated against the correct line numbers in the file diff.
Description | From | Last Updated |
---|---|---|
This is returning None in some cases where it shouldn't be. |
SM smacleod | |
Col: 1 W191 indentation contains tabs |
reviewbot | |
Col: 1 E101 indentation contains mixed spaces and tabs |
reviewbot | |
Col: 35 E702 multiple statements on one line (semicolon) |
reviewbot |
SO
- Change Summary:
-
Fixed typo in Testing
- Testing Done:
-
~ Tested by running ReviewBot (cpplint, pyflakes -- on 1 Cpp file and 1 python script) with the changes and the comments were updated against the correct line numbers in the file diff.
~ Tested by running ReviewBot (cpplint, pep8 -- on 1 Cpp file and 1 python script) with the changes and the comments were updated against the correct line numbers in the file diff.
SM
-
While testing this change I've found it fails to locate some line numbers it should be able to find. I've only seen it happen with unmodified lines, but haven't run nearly enough tests yet. I'm going to dig deeper into the logic here and try and figure out what's happening.
-
SO
- Change Summary:
-
Addressed Pep8 reported issues. Ran pep8 check locally before posting current diff root@RBserver:~/Documents/git/reviewbot# pep8 bot/reviewbot/processing/review.py root@RBserver:~/Documents/git/reviewbot#
- Diff:
-
Revision 3 (+76 -20)