Ensure the reviewboardrc in HOME is only parsed once

Review Request #7232 — Created April 21, 2015 and submitted

Information

RBTools
release-0.7.x
ab49e4f...

Reviewers

Previously, the list of configuration paths for get_config_paths
could have duplicates in the case where the current working directory
is a subdirectory of the home directory and a configuration file exists
in the home directory. This will lead to the config in the home
directory being parsed twice, which is undesirable.

Also the documentation in get_config_paths was incorrect as to the
order of precedence in the returned list of paths. This has been
corrected.

Ran unit tests.

Posted this review request.

Checked the output of get_config_paths before and after applying this
patch. Before applying this patch, my ~/.reviewboardrc appears in the
list of config paths twice. After applying this patch, it only appears
once and is the last element of the list.

Manually verified the result of load_config to ensure that my
./reviewboardrc was only parsed once.

Description From Last Updated

'OrderedDict' imported but unused

reviewbotreviewbot

'six' imported but unused

reviewbotreviewbot

Actually this isn't true. We want the repository-specific one to have the highest precedence.

daviddavid
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        rbtools/utils/filesystem.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        rbtools/utils/filesystem.py
    
    
  2. rbtools/utils/filesystem.py (Diff revision 1)
     
     
     'OrderedDict' imported but unused
    
  3. rbtools/utils/filesystem.py (Diff revision 1)
     
     
     'six' imported but unused
    
  4. 
      
brennie
reviewbot
  1. Tool: PEP8 Style Checker
    Processed Files:
        rbtools/utils/filesystem.py
    
    
    
    Tool: Pyflakes
    Processed Files:
        rbtools/utils/filesystem.py
    
    
  2. 
      
brennie
reviewbot
  1. Tool: PEP8 Style Checker
    Processed Files:
        rbtools/utils/filesystem.py
    
    Ignored Files:
        .reviewboardrc
    
    
    
    Tool: Pyflakes
    Processed Files:
        rbtools/utils/filesystem.py
    
    Ignored Files:
        .reviewboardrc
    
    
  2. 
      
brennie
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        rbtools/utils/filesystem.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        rbtools/utils/filesystem.py
    
    
  2. 
      
david
  1. 
      
  2. rbtools/utils/filesystem.py (Diff revision 4)
     
     
     
     
     

    Actually this isn't true. We want the repository-specific one to have the highest precedence.

  3. 
      
brennie
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        rbtools/utils/filesystem.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        rbtools/utils/filesystem.py
    
    
  2. 
      
david
  1. Ship It!
  2. 
      
brennie
Review request changed

Status: Closed (submitted)

Change Summary:

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