~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/mutabletree.py

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
from bzrlib.lazy_import import lazy_import
24
24
lazy_import(globals(), """
25
25
import os
 
26
import re
26
27
 
27
28
from bzrlib import (
28
29
    add,
427
428
                dirs_to_add.append((path, None))
428
429
            prev_dir = path.raw_path
429
430
 
 
431
        illegalpath_re = re.compile(r'[\r\n]')
430
432
        # dirs_to_add is initialised to a list of directories, but as we scan
431
433
        # directories we append files to it.
432
434
        # XXX: We should determine kind of files when we scan them rather than
443
445
            if not InventoryEntry.versionable_kind(kind):
444
446
                warning("skipping %s (can't add file of kind '%s')", abspath, kind)
445
447
                continue
 
448
            if illegalpath_re.search(directory.raw_path):
 
449
                warning("skipping %r (contains \\n or \\r)" % abspath)
 
450
                continue
446
451
 
447
452
            if parent_ie is not None:
448
453
                versioned = directory.base_path in parent_ie.children