~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

(vila) Implement 'ignore --default-rules', remove 'ignore --old-default-rules' (Parth Malwankar)

Show diffs side-by-side

added added

removed removed

Lines of Context:
2649
2649
    using this command or directly by using an editor, be sure to commit
2650
2650
    it.
2651
2651
    
 
2652
    Bazaar also supports a global ignore file ~/.bazaar/ignore. On Windows
 
2653
    the global ignore file can be found in the application data directory as
 
2654
    C:\\Documents and Settings\\<user>\\Application Data\\Bazaar\\2.0\\ignore.
 
2655
    Global ignores are not touched by this command. The global ignore file
 
2656
    can be edited directly using an editor.
 
2657
 
2652
2658
    Patterns prefixed with '!' are exceptions to ignore patterns and take
2653
2659
    precedence over regular ignores.  Such exceptions are used to specify
2654
2660
    files that should be versioned which would otherwise be ignored.
2695
2701
    _see_also = ['status', 'ignored', 'patterns']
2696
2702
    takes_args = ['name_pattern*']
2697
2703
    takes_options = [
2698
 
        Option('old-default-rules',
2699
 
               help='Write out the ignore rules bzr < 0.9 always used.')
 
2704
        Option('default-rules',
 
2705
               help='Display the default ignore rules that bzr uses.')
2700
2706
        ]
2701
2707
 
2702
 
    def run(self, name_pattern_list=None, old_default_rules=None):
 
2708
    def run(self, name_pattern_list=None, default_rules=None):
2703
2709
        from bzrlib import ignores
2704
 
        if old_default_rules is not None:
2705
 
            # dump the rules and exit
2706
 
            for pattern in ignores.OLD_DEFAULTS:
 
2710
        if default_rules is not None:
 
2711
            # dump the default rules and exit
 
2712
            for pattern in ignores.USER_DEFAULTS:
2707
2713
                self.outf.write("%s\n" % pattern)
2708
2714
            return
2709
2715
        if not name_pattern_list:
2710
2716
            raise errors.BzrCommandError("ignore requires at least one "
2711
 
                                  "NAME_PATTERN or --old-default-rules")
 
2717
                "NAME_PATTERN or --default-rules.")
2712
2718
        name_pattern_list = [globbing.normalize_pattern(p)
2713
2719
                             for p in name_pattern_list]
2714
2720
        for name_pattern in name_pattern_list: