Add support for -X to the Bazaar SCM Client.

Review Request #6349 — Created Sept. 20, 2014 and submitted

Barret Rennie
RBTools
release-0.6.x
6357
6358
cc6e620...
rbtools, students

Bazaar now supports excluding files from diffs and posts via
rbtools.utils.diffs.filter_diff, which looks through the
output of bzr diff for lines indicating the start of a file's
diff. If the file specified matches any pattern, that file's
diff is excluded from the resulting diff or post.

Add a test for checking the result of the BazaarClient's diff
with file exclusion.

Unit tests pass.

Ran rbt dff -X .. in a Bazaar repository and got the specified file was
not included.

  • 0
  • 0
  • 4
  • 1
  • 5
Description From Last Updated
Review Bot
  1. Tool: Pyflakes
    Processed Files:
        rbtools/clients/tests.py
        rbtools/clients/bazaar.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        rbtools/clients/tests.py
        rbtools/clients/bazaar.py
    
    
  2. 
      
Barret Rennie
Barret Rennie
Review Bot
  1. Tool: Pyflakes
    Processed Files:
        rbtools/clients/tests.py
        rbtools/clients/bazaar.py
    
    Ignored Files:
        docs/rbtools/rbt/commands/post.rst
        docs/rbtools/rbt/commands/diff.rst
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        rbtools/clients/tests.py
        rbtools/clients/bazaar.py
    
    Ignored Files:
        docs/rbtools/rbt/commands/post.rst
        docs/rbtools/rbt/commands/diff.rst
    
    
  2. 
      
David Trowbridge
  1. 
      
  2. rbtools/clients/bazaar.py (Diff revision 2)
     
     

    If there's a diff but no exclude_patterns, I think this would end up calling join() and passing in a single string (which probably works since strings are iterable but could be very inefficient). How about something like this:

    if exclude_patterns:
        return ''.join(self._filter_diff(diff, exclude_patterns))
    else:
        return diff
    
    1. The execute call has split_lines=True set, so this will return an array of strings.

  3. 
      
Anselina Chia
  1. 
      
  2. rbtools/clients/tests.py (Diff revision 2)
     
     

    This is very minor, but there's an extra blank line here.

  3. 
      
David Trowbridge
  1. 
      
  2. rbtools/clients/tests.py (Diff revision 2)
     
     
     

    This isn't aligned properly. The result... is a parameter to filter(), not len()

  3. 
      
Barret Rennie
Review Bot
  1. Tool: Pyflakes
    Processed Files:
        rbtools/clients/tests.py
        rbtools/clients/svn.py
        rbtools/clients/bazaar.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/tests.py
        rbtools/clients/svn.py
        rbtools/clients/bazaar.py
        rbtools/utils/diffs.py
    
    Ignored Files:
        docs/rbtools/rbt/commands/post.rst
        docs/rbtools/rbt/commands/diff.rst
    
    
  2. rbtools/clients/bazaar.py (Diff revision 3)
     
     
     'fnmatch' imported but unused
    
  3. rbtools/clients/svn.py (Diff revision 3)
     
     
     'fnmatch' imported but unused
    
  4. 
      
Barret Rennie
Review Bot
  1. Tool: Pyflakes
    Processed Files:
        rbtools/clients/tests.py
        rbtools/clients/svn.py
        rbtools/clients/bazaar.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/tests.py
        rbtools/clients/svn.py
        rbtools/clients/bazaar.py
        rbtools/utils/diffs.py
    
    Ignored Files:
        docs/rbtools/rbt/commands/post.rst
        docs/rbtools/rbt/commands/diff.rst
    
    
  2. 
      
David Trowbridge
  1. Can you separate this into two changes? One for bzr and the other for svn?

    1. The refactoring of _filter_diff into rbtools.utils.diffs.filter_diff is now in review request 6357

  2. 
      
Barret Rennie
Review Bot
  1. Tool: Pyflakes
    Processed Files:
        rbtools/clients/tests.py
        rbtools/clients/bazaar.py
    
    Ignored Files:
        docs/rbtools/rbt/commands/post.rst
        docs/rbtools/rbt/commands/diff.rst
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        rbtools/clients/tests.py
        rbtools/clients/bazaar.py
    
    Ignored Files:
        docs/rbtools/rbt/commands/post.rst
        docs/rbtools/rbt/commands/diff.rst
    
    
  2. 
      
David Trowbridge
  1. Ship It!

  2. 
      
Barret Rennie
Review request changed

Status: Closed (submitted)

Change Summary:

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