~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

'bzr ignore' now fails on bad patterns. failing patterns are displayed.

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 += ('\n  %s' % p)
 
2719
        if bad_patterns:
 
2720
            msg = ('Invalid ignore pattern(s) found. %s' % bad_patterns)
 
2721
            ui.ui_factory.show_error(msg)
 
2722
            raise errors.InvalidPattern('')
2715
2723
        for name_pattern in name_pattern_list:
2716
2724
            if (name_pattern[0] == '/' or
2717
2725
                (len(name_pattern) > 1 and name_pattern[1] == ':')):