Fix unicode-related error for SVN when using --repository-url option

Review Request #7644 — Created Sept. 19, 2015 and submitted

Information

RBTools
master

Reviewers

Fix a lurking unicode string in get_repository_info() for specifying the
default base_path. This could cause a crash in convert_to_absolute_paths()
when joining with a filename containing non-UTF8 characters. This case was
only accessible when the --repository-url option was specified.

Added a new test case to exercise this bug, and it failed as expected before the
fix was introduced. Since this case requires --repository-url it is necessary
to update the testdata repository to contain a file with a non-UTF8 filename.
Thus, I introduced revision 4 to the repo which adds a single file with a non-UTF8
character in both its name and file contents.

Causing HEAD of the testrepo to advance to r4 in turn caused the existing
test_diff_exclude() test to fail. This is because this test was modifying
foo.txt, which is already in the repo, which causes the diff signature to
change to indicate revision 4 versus 3. This is the only test case that has a
dependency on the current HEAD revision number, so to prevent this regression
from occurring again in the future, I altered the test to add a new new file
(bar.txt) rather than modifying an existing file. This change in approach
does not impact the underlying purpose of the test. Note, since the diff
signature for file additions varies between SVN client versions the decorator is
now utilized to generate the correct MD5 hash.

Ran all unit tests under both SVN 1.6.23 and 1.7.14.

Description From Last Updated

Col: 80 E501 line too long (93 > 79 characters)

reviewbotreviewbot
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        rbtools/clients/tests.py
        rbtools/clients/svn.py
    
    Ignored Files:
        rbtools/clients/testdata/svn-repo/db/txn-current
        rbtools/clients/testdata/svn-repo/db/current
        rbtools/clients/testdata/svn-repo/db/revprops/0/4
        rbtools/clients/testdata/svn-repo/db/revs/0/4
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        rbtools/clients/tests.py
        rbtools/clients/svn.py
    
    Ignored Files:
        rbtools/clients/testdata/svn-repo/db/txn-current
        rbtools/clients/testdata/svn-repo/db/current
        rbtools/clients/testdata/svn-repo/db/revprops/0/4
        rbtools/clients/testdata/svn-repo/db/revs/0/4
    
    
  2. rbtools/clients/tests.py (Diff revision 1)
     
     
    Show all issues
    Col: 80
     E501 line too long (93 > 79 characters)
    
  3. 
      
gmyers
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        rbtools/clients/tests.py
        rbtools/clients/svn.py
    
    Ignored Files:
        rbtools/clients/testdata/svn-repo/db/txn-current
        rbtools/clients/testdata/svn-repo/db/current
        rbtools/clients/testdata/svn-repo/db/revprops/0/4
        rbtools/clients/testdata/svn-repo/db/revs/0/4
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        rbtools/clients/tests.py
        rbtools/clients/svn.py
    
    Ignored Files:
        rbtools/clients/testdata/svn-repo/db/txn-current
        rbtools/clients/testdata/svn-repo/db/current
        rbtools/clients/testdata/svn-repo/db/revprops/0/4
        rbtools/clients/testdata/svn-repo/db/revs/0/4
    
    
  2. 
      
david
  1. This change looks pretty good. Unfortunately, "rbtools/clients/testdata/svn-repo/db/revs/0/4" was detected as a binary file and we didn't get the contents. Can you make this change available on a git clone somewhere?

    1. Since it was binary, I did attach the file to the original request.  Is that sufficient?  If it's not then I'll venture into new git territory for me and figure out how to do the clone.
    2. Oh, I didn't even see the file attachment. Thanks!

  2. 
      
david
  1. Ship It!
  2. 
      
gmyers
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-0.7.x (7dd1ea2)
Loading...