~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/globbing.py

  • Committer: John Whitley
  • Date: 2010-01-02 23:33:47 UTC
  • mto: This revision was merged to the branch mainline in revision 4981.
  • Revision ID: whitley@bangpath.org-20100102233347-uw865beilj5uk1hb
Add descriptive text to ExcludingGlobster.

Show diffs side-by-side

added added

removed removed

Lines of Context:
216
216
        return None
217
217
 
218
218
class ExcludingGlobster(object):
219
 
    """A Globster that supports exclusion patterns."""
 
219
    """A Globster that supports exclusion patterns.
 
220
    
 
221
    These are ignore patterns prefixed with '!'.  Exclusion
 
222
    patterns take precedence over regular patterns and negate the
 
223
    normal matching logic, causing a matching filename to return
 
224
    None from the match() function.
 
225
    """
220
226
    
221
227
    def __init__(self,patterns):
222
228
        ignores = []
267
273
 
268
274
    Doesn't normalize regular expressions - they may contain escapes.
269
275
    """
270
 
 
271
276
    if not (pattern.startswith('RE:') or pattern.startswith('!RE:')):
272
277
        pattern = _slashes.sub('/', pattern)
273
278
    if len(pattern) > 1: