~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commands.py

  • Committer: Martin Pool
  • Date: 2005-05-10 07:06:05 UTC
  • Revision ID: mbp@sourcefrog.net-20050510070605-0a2453ae5db6fc3c
- new command 'bzr added'

Show diffs side-by-side

added added

removed removed

Lines of Context:
503
503
            if cacheentry[statcache.SC_SHA1] != ie.text_sha1:
504
504
                path = inv.id2path(file_id)
505
505
                print path
 
506
 
 
507
 
 
508
 
 
509
class cmd_added(Command):
 
510
    """List files added in working tree."""
 
511
    hidden = True
 
512
    def run(self):
 
513
        b = Branch('.')
 
514
        wt = b.working_tree()
 
515
        basis_inv = b.basis_tree().inventory
 
516
        inv = wt.inventory
 
517
        for file_id in inv:
 
518
            if file_id in basis_inv:
 
519
                continue
 
520
            path = inv.id2path(file_id)
 
521
            if not os.access(b.abspath(path), os.F_OK):
 
522
                continue
 
523
            print path
506
524
                
507
525
        
508
526