~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

'bzr ignore' now fails on bad pattern.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2712
2712
                "NAME_PATTERN or --default-rules.")
2713
2713
        name_pattern_list = [globbing.normalize_pattern(p)
2714
2714
                             for p in name_pattern_list]
 
2715
        bad_patterns = []
 
2716
        for p in name_pattern_list:
 
2717
            if not globbing.Globster.is_pattern_valid(p):
 
2718
                bad_patterns.append(p)
 
2719
        if bad_patterns:
 
2720
            msg = 'Invalid ignore patterns found.'
 
2721
            pats = ''
 
2722
            for p in bad_patterns:
 
2723
                pats += ('\n  %s' % p)
 
2724
            ui.ui_factory.show_error(msg + pats)
 
2725
            raise errors.InvalidPattern('')
2715
2726
        for name_pattern in name_pattern_list:
2716
2727
            if (name_pattern[0] == '/' or
2717
2728
                (len(name_pattern) > 1 and name_pattern[1] == ':')):