• 
      

    diffviewer has issues with .cpp .C .H .cc and other files

    Review Request #1358 — Created Jan. 21, 2010 and submitted — Latest diff uploaded

    Information

    Review Board

    Reviewers

    A small typo in diffutils.py leads to 
    
    .c
    
    Traceback (most recent call last):
      File "/home/aharvey/Code/reviewboard/reviewboard/diffviewer/views.py", line 153, in view_diff
        interdiffset, highlighting, True)
      File "/home/aharvey/Code/reviewboard/reviewboard/diffviewer/diffutils.py", line 880, in get_diff_files
        large_data=True)
      File "/usr/local/lib/python2.6/dist-packages/Djblets-0.5.7alpha0.dev-py2.6.egg/djblets/util/misc.py", line 162, in cache_memoize
        data = lookup_callable()
      File "/home/aharvey/Code/reviewboard/reviewboard/diffviewer/diffutils.py", line 879, in <lambda>
        enable_syntax_highlighting)),
      File "/home/aharvey/Code/reviewboard/reviewboard/diffviewer/diffutils.py", line 601, in get_chunks
        register_interesting_lines_for_filename(differ, file)
      File "/home/aharvey/Code/reviewboard/reviewboard/diffviewer/diffutils.py", line 375, in register_interesting_lines_for_filename
        regexes = HEADER_REGEXES[HEADER_REGEX_ALIASES[ext]]
    KeyError: '.c'
    
    The fixes is straight forward there is no .c in the diffutils.py, it looks like there was a typo, that the .c was set to .h in key.
    Load a diff with a .cpp file, does not showup in the diff viewer, applied the attached diff, .cpp and .c now display correctly.