1064
1064
verbose=verbose)
1067
class cmd_unversion(Command):
1068
"""Make a file unversioned.
1067
class cmd_remove(Command):
1068
"""Remove files or directories..
1070
This makes bzr stop tracking changes to a versioned file. It does
1071
not delete the working copy.
1070
This makes bzr stop tracking changes to the specified files and
1071
delete them if they can easily be recovered using revert.
1073
1073
You can specify one or more files, and/or --new. If you specify --new,
1074
only 'added' files will be unversioned. If you specify both, then new
1074
only 'added' files will be removed. If you specify both, then new
1075
1075
files in the specified directories will be removed. If the directories are
1076
also new, they will also be unversioned.
1076
also new, they will also be removed.
1078
1078
takes_args = ['file*']
1079
takes_options = ['verbose', Option('new',
1080
help='unversion newly-added files')]
1079
takes_options = ['verbose',
1080
Option('new', help='remove newly-added files'),
1081
Option('keep', help="never delete files"),
1082
Option('force', help="always delete files, even if they can not be "
1083
"recovered and even if they are non-empty directories")]
1082
1085
encoding_type = 'replace'
1084
1087
def __init__(self):
1085
1088
Command.__init__(self)
1086
1089
self.no_files_message=('Specify one or more files to'
1087
' unversion, or use --new.')
1088
self.delete_files=False
1090
' remove, or use --new.')
1090
def run(self, file_list, verbose=False, new=False):
1092
def run(self, file_list, verbose=False, new=False, keep=False,
1091
1094
tree, file_list = tree_files(file_list)
1093
1096
if file_list is not None:
1102
1105
if len(file_list) == 0:
1103
1106
raise errors.BzrCommandError('No matching files.')
1104
1107
tree.remove(file_list, verbose=verbose, to_file=self.outf,
1105
delete_files=self.delete_files)
1108
class cmd_remove(cmd_unversion):
1111
This makes bzr stop tracking changes to a versioned file and delete the
1112
working copy. (Recursion not supported at present.)
1114
You can specify one or more files, and/or --new. If you specify --new,
1115
only 'added' files will be removed. If you specify both, then new files
1116
in the specified directories will be removed. If the directories are
1117
also new and empty, they will also be removed.
1119
takes_args = ['file*']
1120
takes_options = ['verbose', Option('new', help='remove newly-added files')]
1122
encoding_type = 'replace'
1125
Command.__init__(self)
1126
self.delete_files=True
1127
self.no_files_message=('Specify one or more files to'
1128
' remove, or use --new.')
1108
keep_files=keep, force=force)
1131
1111
class cmd_file_id(Command):