~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: wang
  • Date: 2006-10-10 07:36:21 UTC
  • mto: (2104.1.1 jam-integration)
  • mto: This revision was merged to the branch mainline in revision 2105.
  • Revision ID: wang@ubuntu-20061010073621-c17937e940897fdc
"bzr ignore" takes multiple arguments. Fixes bug 29488.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1526
1526
 
1527
1527
 
1528
1528
class cmd_ignore(Command):
1529
 
    """Ignore a command or pattern.
 
1529
    """Ignore specified files or patterns.
1530
1530
 
1531
1531
    To remove patterns from the ignore list, edit the .bzrignore file.
1532
1532
 
1544
1544
        bzr ignore '*.class'
1545
1545
    """
1546
1546
    # TODO: Complain if the filename is absolute
1547
 
    takes_args = ['name_pattern?']
 
1547
    takes_args = ['name_pattern*']
1548
1548
    takes_options = [
1549
1549
                     Option('old-default-rules',
1550
1550
                            help='Out the ignore rules bzr < 0.9 always used.')
1551
1551
                     ]
1552
1552
    
1553
 
    def run(self, name_pattern=None, old_default_rules=None):
 
1553
    def run(self, name_pattern_list=[], old_default_rules=None):
1554
1554
        from bzrlib.atomicfile import AtomicFile
1555
1555
        if old_default_rules is not None:
1556
1556
            # dump the rules and exit
1557
1557
            for pattern in ignores.OLD_DEFAULTS:
1558
1558
                print pattern
1559
1559
            return
1560
 
        if name_pattern is None:
 
1560
        if name_pattern_list == []:
1561
1561
            raise BzrCommandError("ignore requires a NAME_PATTERN")
1562
1562
        tree, relpath = WorkingTree.open_containing(u'.')
1563
1563
        ifn = tree.abspath('.bzrignore')
1575
1575
 
1576
1576
        if igns and igns[-1] != '\n':
1577
1577
            igns += '\n'
1578
 
        igns += name_pattern + '\n'
 
1578
        for name_pattern in name_pattern_list:
 
1579
            igns += name_pattern + '\n'
1579
1580
 
1580
1581
        f = AtomicFile(ifn, 'wt')
1581
1582
        try: