Show More
@@ -29,6 +29,17 b' from mercurial import util, commands, cm' | |||||
29 | from mercurial.i18n import _ |
|
29 | from mercurial.i18n import _ | |
30 | import os, stat |
|
30 | import os, stat | |
31 |
|
31 | |||
|
32 | cmdtable = {} | |||
|
33 | command = cmdutil.command(cmdtable) | |||
|
34 | ||||
|
35 | @command('purge|clean', | |||
|
36 | [('a', 'abort-on-err', None, _('abort if an error occurs')), | |||
|
37 | ('', 'all', None, _('purge ignored files too')), | |||
|
38 | ('p', 'print', None, _('print filenames instead of deleting them')), | |||
|
39 | ('0', 'print0', None, _('end filenames with NUL, for use with xargs' | |||
|
40 | ' (implies -p/--print)')), | |||
|
41 | ] + commands.walkopts, | |||
|
42 | _('hg purge [OPTION]... [DIR]...')) | |||
32 | def purge(ui, repo, *dirs, **opts): |
|
43 | def purge(ui, repo, *dirs, **opts): | |
33 | '''removes files not tracked by Mercurial |
|
44 | '''removes files not tracked by Mercurial | |
34 |
|
45 | |||
@@ -97,15 +108,3 b' def purge(ui, repo, *dirs, **opts):' | |||||
97 | if match(f) and not os.listdir(repo.wjoin(f)): |
|
108 | if match(f) and not os.listdir(repo.wjoin(f)): | |
98 | ui.note(_('Removing directory %s\n') % f) |
|
109 | ui.note(_('Removing directory %s\n') % f) | |
99 | remove(os.rmdir, f) |
|
110 | remove(os.rmdir, f) | |
100 |
|
||||
101 | cmdtable = { |
|
|||
102 | 'purge|clean': |
|
|||
103 | (purge, |
|
|||
104 | [('a', 'abort-on-err', None, _('abort if an error occurs')), |
|
|||
105 | ('', 'all', None, _('purge ignored files too')), |
|
|||
106 | ('p', 'print', None, _('print filenames instead of deleting them')), |
|
|||
107 | ('0', 'print0', None, _('end filenames with NUL, for use with xargs' |
|
|||
108 | ' (implies -p/--print)')), |
|
|||
109 | ] + commands.walkopts, |
|
|||
110 | _('hg purge [OPTION]... [DIR]...')) |
|
|||
111 | } |
|
General Comments 0
You need to be logged in to leave comments.
Login now