~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-10-07 09:59:40 UTC
  • mfrom: (5444.3.3 rm-no-backup-400554)
  • Revision ID: pqm@pqm.ubuntu.com-20101007095940-gxv0029giim7oti3
(vila) add 'bzr rm --no-backup' and deprecate the --force opting to be
 consitent with revert (Marius Kruger)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1507
1507
            title='Deletion Strategy', value_switches=True, enum_switch=False,
1508
1508
            safe='Backup changed files (default).',
1509
1509
            keep='Delete from bzr but leave the working copy.',
 
1510
            no_backup='Don\'t backup changed files.',
1510
1511
            force='Delete all the specified files, even if they can not be '
1511
 
                'recovered and even if they are non-empty directories.')]
 
1512
                'recovered and even if they are non-empty directories. '
 
1513
                '(deprecated, use no-backup)')]
1512
1514
    aliases = ['rm', 'del']
1513
1515
    encoding_type = 'replace'
1514
1516
 
1515
1517
    def run(self, file_list, verbose=False, new=False,
1516
1518
        file_deletion_strategy='safe'):
 
1519
        if file_deletion_strategy == 'force':
 
1520
            note("(The --force option is deprecated, rather use --no-backup "
 
1521
                "in future.)")
 
1522
            file_deletion_strategy = 'no-backup'
 
1523
 
1517
1524
        tree, file_list = WorkingTree.open_containing_paths(file_list)
1518
1525
 
1519
1526
        if file_list is not None:
1540
1547
            file_deletion_strategy = 'keep'
1541
1548
        tree.remove(file_list, verbose=verbose, to_file=self.outf,
1542
1549
            keep_files=file_deletion_strategy=='keep',
1543
 
            force=file_deletion_strategy=='force')
 
1550
            force=(file_deletion_strategy=='no-backup'))
1544
1551
 
1545
1552
 
1546
1553
class cmd_file_id(Command):