Switch to fuzzy search in setup-repo to match repository path

Review Request #5724 — Created April 22, 2014 and submitted

Information

RBTools
master

Reviewers

Sometimes repository path on reviewboard server and on local copy of repository may contains slight difference (trailing slash, user credentials, etc.)

Now rbt setup-repo offers repository with closest path to local path.

Unit testing with nosetests

Ran 108 tests in 38.481s

OK (SKIP=24)

chipx86
  1. Some people do want their credentials in paths to match, so this will end up breaking some users out there.

    It's probably also not the right place to do the match. This code shouldn't enforce lookup-related policies, and instead should use what it's given.

    I think the right place for this is directly in rbt setup-repo. I could see setup-repo trying a couple variations (with and without credentials) for the lookups, but not rbt post or anything on the RB side. What we want to strongly encourage is using name-based lookups, and not path-based, since they're faster and less error-prone. rb setup-repo will set up a path-based repo, but could benefit from having this more fuzzy match to find the proper repo, if a direct match doesn't exist.

  2. 
      
1T
david
  1. The code looks better, but can you update your change description to describe the new behavior?

  2. 
      
1T
david
  1. I'm going to make some changes to make this more compatible with older (and newer) versions of python, then push it. Thanks!

  2. 
      
1T
Review request changed
Status:
Completed
Change Summary:
Pushed to release-0.6.x (8a0e94a)