~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commands.py

  • Committer: Martin Pool
  • Date: 2005-04-28 10:01:44 UTC
  • Revision ID: mbp@sourcefrog.net-20050428100144-e9d4ccfe5fb236df
- new 'bzr ignored' command!

Show diffs side-by-side

added added

removed removed

Lines of Context:
602
602
 
603
603
 
604
604
 
 
605
def cmd_ignore(name_pattern):
 
606
    """Ignore a command or pattern"""
 
607
 
 
608
    b = Branch('.')
 
609
 
 
610
    f = open(b.abspath('.bzrignore'), 'at')
 
611
    f.write(name_pattern + '\n')
 
612
    f.close()
 
613
    
 
614
    inv = b.working_tree().inventory
 
615
    if inv.path2id('.bzrignore'):
 
616
        mutter('.bzrignore is already versioned')
 
617
    else:
 
618
        mutter('need to make new .bzrignore file versioned')
 
619
        b.add(['.bzrignore'])
 
620
 
 
621
 
 
622
 
605
623
def cmd_ignored():
606
624
    """List ignored files and the patterns that matched them.
607
625
      """
869
887
    'get-revision':           ['revision_id'],
870
888
    'get-revision-inventory': ['revision_id'],
871
889
    'help':                   ['topic?'],
 
890
    'ignore':                 ['name_pattern'],
872
891
    'init':                   [],
873
892
    'log':                    [],
874
893
    'lookup-revision':        ['revno'],