~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commands.py

  • Committer: mbp at sourcefrog
  • Date: 2005-03-29 06:10:25 UTC
  • Revision ID: mbp@sourcefrog.net-20050329061025-6646f5d3b6bae417
new --show-ids option for 'deleted' command

Show diffs side-by-side

added added

removed removed

Lines of Context:
339
339
 
340
340
 
341
341
 
342
 
def cmd_deleted():
 
342
def cmd_deleted(show_ids=False):
343
343
    """List files deleted in the working tree.
344
344
 
345
345
TODO: Show files deleted since a previous revision, or between two revisions.
350
350
 
351
351
    for path, ie in old.inventory.iter_entries():
352
352
        if not new.has_id(ie.file_id):
353
 
            print path
 
353
            if show_ids:
 
354
                print '%-50s %s' % (path, ie.file_id)
 
355
            else:
 
356
                print path
 
357
                
354
358
    
355
359
 
356
360
 
618
622
cmd_options = {
619
623
    'add':                    ['verbose'],
620
624
    'commit':                 ['message', 'verbose'],
 
625
    'deleted':                ['show-ids'],
621
626
    'diff':                   ['revision'],
622
627
    'inventory':              ['revision'],
623
 
    'log':                    ['show-ids', 'timezone'],
 
628
    'log':                    ['timezone'],
624
629
    'ls':                     ['revision', 'verbose'],
625
630
    'remove':                 ['verbose'],
626
631
    'status':                 ['all'],
700
705
                    else:
701
706
                        optarg = argv.pop(0)
702
707
                opts[optname] = optargfn(optarg)
703
 
                mutter("    option argument %r" % opts[optname])
704
708
            else:
705
709
                if optarg != None:
706
710
                    bailout('option %r takes no argument' % optname)
799
803
                    % (oname, cmd))
800
804
 
801
805
    cmdargs = _match_args(cmd, args)
802
 
    cmdargs.update(opts)
 
806
    for k, v in opts.items():
 
807
        cmdargs[k.replace('-', '_')] = v
803
808
 
804
809
    ret = cmd_handler(**cmdargs) or 0
805
810