~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/globbing.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-11-30 22:04:45 UTC
  • mfrom: (4789.28.4 2.1.0b4-builder-no-keys)
  • Revision ID: pqm@pqm.ubuntu.com-20091130220445-vbfmmgocbgcs195q
(jam) Update BTreeBuilder to remove ._keys and use StaticTuple

Show diffs side-by-side

added added

removed removed

Lines of Context:
238
238
                    prefix=r'(?:.*/)?(?!.*/)')
239
239
 
240
240
 
 
241
_slashes = re.compile(r'[\\/]+')
241
242
def normalize_pattern(pattern):
242
243
    """Converts backslashes in path patterns to forward slashes.
243
244
 
244
245
    Doesn't normalize regular expressions - they may contain escapes.
245
246
    """
 
247
 
246
248
    if not pattern.startswith('RE:'):
247
 
        pattern = pattern.replace('\\','/')
248
 
    return pattern.rstrip('/')
 
249
        pattern = _slashes.sub('/', pattern)
 
250
    if len(pattern) > 1:
 
251
        pattern = pattern.rstrip('/')
 
252
    return pattern