Fix looking up Subversion repositories by UUID.

Review Request #8226 — Created June 9, 2016 and submitted

Information

RBTools
release-0.7.x
5d53f25...

Reviewers

In RBTools 0.7.6, we introduced new helpers for iterating over pages of
API list resources, and switched the SVN repository lookups to use it.
Unfortunately, switching form a list to a generator meant that we were
no longer able to loop over the requests a second time for the UUID
checks.

We now store a cached list of the repositories we iterate through, so
that we can loop over them for the UUID step (if needed). We do this
instead of immediately converting the generator to a list in order to
reduce lookups against the API.

Unit tests were added to ensure the conditions all work and won't
regress again.

Tested against a list of repositories and verified that both loops
were able to operate on the entire list of repositories from the API.

Description From Last Updated

Why is supports_parent_diffs being ripped out?

brenniebrennie

"match a repository" instead of "match a match"?

gmyersgmyers

Why not just do repositories = list(server.get_repositories(tool='Subversion').all_items) ?

daviddavid
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        rbtools/api/tests.py
        rbtools/clients/svn.py
        rbtools/clients/tests.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        rbtools/api/tests.py
        rbtools/clients/svn.py
        rbtools/clients/tests.py
    
    
  2. 
      
brennie
  1. 
      
  2. rbtools/clients/svn.py (Diff revision 1)
     
     

    Why is supports_parent_diffs being ripped out?

    1. We never pass a value for this, and it's already False by default in the parent constructor.

  3. 
      
ST
  1. Patch worked for me, thanks!

  2. 
      
gmyers
  1. 
      
  2. rbtools/clients/svn.py (Diff revision 1)
     
     
    "match a repository" instead of "match a match"?
  3. 
      
chipx86
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        rbtools/api/tests.py
        rbtools/clients/svn.py
        rbtools/clients/tests.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        rbtools/api/tests.py
        rbtools/clients/svn.py
        rbtools/clients/tests.py
    
    
  2. 
      
david
  1. 
      
  2. rbtools/clients/svn.py (Diff revision 2)
     
     
     
     
     
     

    Why not just do repositories = list(server.get_repositories(tool='Subversion').all_items) ?

    1. I can elaborate in the comment, but say you have 5 pages of Subversion repositories. If your repository isn't on page 5, you don't want to have to fetch page 5. By doing it the way I have it in code, if it's on page 1, or 2, etc., we have it and don't have to look any further.

    2. That makes sense. Elaboration in the comment would be good.

  3. 
      
chipx86
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        rbtools/api/tests.py
        rbtools/clients/svn.py
        rbtools/clients/tests.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        rbtools/api/tests.py
        rbtools/clients/svn.py
        rbtools/clients/tests.py
    
    
  2. 
      
david
  1. Ship It!
  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-0.7.x (ad7dfc5)
Loading...