Add relative exclude pattern support to Git, SVN, CVS, and Bazaar SCMClients.

Review Request #6383 — Created Sept. 29, 2014 and submitted

brennie
RBTools
master
6376
rbtools, students

Exclude patterns are now interpreted as relative to the current
working directory.

Add rbtools.utils.diffs:normalize_patterns which normalizes patterns,
which are interpreted as relative to the current working directory,
into patterns matching only absolute paths.

Simplify logic of rbtools.utils.diffs:filter_diff to use
filename_match_any_patterns instead of looping through patterns.

The rbtools.utils.diffs functions filename_match_any_patterns,
filter_diff, and remove_filenames_matching_patterns now take an
extra parameter: base_dir. This argument indicates the directory
that the files are located in. If this argument is not provided, it is
interpreted as the current working directory.

Add GitClient._get_root_directory which finds the absolute path of
the git repository.

All SCMClients that support file exclusion normalize their exclude
patterns. This is not done outside of the respective diff methods
because Perforce exclude patterns require special treatment for depot
file patterns.

The SVN SCMClient no longer prepends / to patterns as it no longer
matches the / in the Index: line as the file path as they are now
interpreted as relative file paths.

Update documentation for rbt diff and rbt post to indicate that
-X specifies relative exclude patterns. Also add a note that Perforce
can specify depot-specific exclude patterns.

Unit tests pass.

Ran rbt diff -X in SVN, CVS, Git, and Bazaar repositories with
relative paths. Files were excluded as expected.

  • 0
  • 0
  • 1
  • 0
  • 1
Description From Last Updated
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        rbtools/clients/cvs.py
        rbtools/clients/svn.py
        rbtools/clients/bazaar.py
        rbtools/clients/git.py
        rbtools/utils/diffs.py
    
    Ignored Files:
        docs/rbtools/rbt/commands/post.rst
        docs/rbtools/rbt/commands/diff.rst
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        rbtools/clients/cvs.py
        rbtools/clients/svn.py
        rbtools/clients/bazaar.py
        rbtools/clients/git.py
        rbtools/utils/diffs.py
    
    Ignored Files:
        docs/rbtools/rbt/commands/post.rst
        docs/rbtools/rbt/commands/diff.rst
    
    
  2. rbtools/utils/diffs.py (Diff revision 1)
     
     
    Col: 1
     E302 expected 2 blank lines, found 1
    
  3. 
      
brennie
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        rbtools/clients/cvs.py
        rbtools/clients/svn.py
        rbtools/clients/bazaar.py
        rbtools/clients/git.py
        rbtools/utils/diffs.py
    
    Ignored Files:
        docs/rbtools/rbt/commands/post.rst
        docs/rbtools/rbt/commands/diff.rst
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        rbtools/clients/cvs.py
        rbtools/clients/svn.py
        rbtools/clients/bazaar.py
        rbtools/clients/git.py
        rbtools/utils/diffs.py
    
    Ignored Files:
        docs/rbtools/rbt/commands/post.rst
        docs/rbtools/rbt/commands/diff.rst
    
    
  2. 
      
  1. Well documented. good work

  2. 
      
david
  1. Ship It!

  2. 
      
brennie
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-0.6.x (a4416cc)
Loading...