Fix CVSROOT validation and diff parsing issues with CVS.

Review Request #8220 — Created June 6, 2016 and submitted

Information

Review Board
release-2.0.x

Reviewers

Our CVS support worked fine if using :pserver: or similar repository
paths, but had a number of problems if using :ext:, :local:,
:fork:, or others. The path would go through fine, but we'd fail to
strip the leading repository path from any referenced files in diffs,
and fail to strip the trailing ,v. This caused files to show up as
moved, and to not have any syntax highlighting.

On top of this, even if the CVSROOT was one of the blessed ones, a diff
could still end up showing the file as moved, depending on the
RCS File line.

We now have a more complex, thorough CVSROOT parsing function, which
supports validation and cleaning of CVSROOTs, based on the logic found
in CVS itself. This covers all the common (and some uncommon) types of
CVSROOTs, parsing out the correct data for each. It also supports
showing errors to the repository form if some data was invalid (such as
when you try to use passwords or ports for :ext:).

Diff parsing is also smarter now, stripping out the ,v in all cases
and preventing files from showing up as moved.

Unit tests were added for all these conditions.

Unit tests pass.

Tested validation in the repository form by hand.

Tested that :ext: repositories and :local: repositories no longer
result in diffs that appear as plain text and moved.

Description From Last Updated

Leftover debug output.

daviddavid
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/scmtools/cvs.py
        reviewboard/scmtools/tests.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/scmtools/cvs.py
        reviewboard/scmtools/tests.py
    
    
  2. 
      
chipx86
david
  1. 
      
  2. reviewboard/scmtools/cvs.py (Diff revision 1)
     
     
    Show all issues

    Leftover debug output.

  3. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to release-2.0.x (887b02e)