contrib/purge/purge.py
author Matt Mackall <mpm@selenic.com>
Sat, 16 Dec 2006 14:41:34 -0600
changeset 3911 fe075ddf3272
parent 2401 dbeaa4369121
child 3943 05c703c281ff
permissions -rw-r--r--
convert-repo: avoid adding bogus value to shamap on tag update
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2364
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
     1
#!/usr/bin/env python
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
     2
#
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
     3
# Copyright (C) 2006 - Marco Barisione <marco@barisione.org>
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
     4
#
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
     5
# This is a small extension for Mercurial (http://www.selenic.com/mercurial)
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
     6
# that removes files not known to mercurial
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
     7
#
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
     8
# This program is free software; you can redistribute it and/or modify
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
     9
# it under the terms of the GNU General Public License as published by
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    10
# the Free Software Foundation; either version 2 of the License, or
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    11
# (at your option) any later version.
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    12
#
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    13
# This program is distributed in the hope that it will be useful,
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    14
# but WITHOUT ANY WARRANTY; without even the implied warranty of
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    15
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    16
# GNU General Public License for more details.
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    17
#
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    18
# You should have received a copy of the GNU General Public License
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    19
# along with this program; if not, write to the Free Software
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    20
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    21
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    22
from mercurial import hg, util
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    23
import os
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    24
2376
52cfb9864257 Marked strings for translation
Marco Barisione <marco@barisione.org>
parents: 2375
diff changeset
    25
def _(s):
52cfb9864257 Marked strings for translation
Marco Barisione <marco@barisione.org>
parents: 2375
diff changeset
    26
    return s
52cfb9864257 Marked strings for translation
Marco Barisione <marco@barisione.org>
parents: 2375
diff changeset
    27
2364
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    28
class Purge(object):
2378
6e5d40ec862d Removed --nothing, added --print and --print0
Marco Barisione <marco@barisione.org>
parents: 2377
diff changeset
    29
    def __init__(self, act=True, abort_on_err=False, eol='\n'):
2364
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    30
        self._repo = None
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    31
        self._ui = None
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    32
        self._hg_root = None
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    33
        self._act = act
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    34
        self._abort_on_err = abort_on_err
2378
6e5d40ec862d Removed --nothing, added --print and --print0
Marco Barisione <marco@barisione.org>
parents: 2377
diff changeset
    35
        self._eol = eol
2364
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    36
2377
626779aba9bb The meaning of the directories on the command line is now explained correctly
Marco Barisione <marco@barisione.org>
parents: 2376
diff changeset
    37
    def purge(self, ui, repo, dirs=None):
2364
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    38
        self._repo = repo
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    39
        self._ui = ui
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    40
        self._hg_root = self._split_path(repo.root)
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    41
2377
626779aba9bb The meaning of the directories on the command line is now explained correctly
Marco Barisione <marco@barisione.org>
parents: 2376
diff changeset
    42
        if not dirs:
626779aba9bb The meaning of the directories on the command line is now explained correctly
Marco Barisione <marco@barisione.org>
parents: 2376
diff changeset
    43
            dirs = [repo.root]
2364
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    44
2377
626779aba9bb The meaning of the directories on the command line is now explained correctly
Marco Barisione <marco@barisione.org>
parents: 2376
diff changeset
    45
        for path in dirs:
2364
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    46
            path = os.path.abspath(path)
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    47
            for root, dirs, files in os.walk(path, topdown=False):
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    48
                if '.hg' in self._split_path(root):
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    49
                    # Skip files in the .hg directory.
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    50
                    # Note that if the repository is in a directory
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    51
                    # called .hg this command does not work.
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    52
                    continue
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    53
                for name in files:
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    54
                    self._remove_file(os.path.join(root, name))
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    55
                if not os.listdir(root):
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    56
                    # Remove this directory if it is empty.
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    57
                    self._remove_dir(root)
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    58
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    59
        self._repo = None
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    60
        self._ui = None
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    61
        self._hg_root = None
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    62
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    63
    def _error(self, msg):
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    64
        if self._abort_on_err:
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    65
            raise util.Abort(msg)
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    66
        else:
2376
52cfb9864257 Marked strings for translation
Marco Barisione <marco@barisione.org>
parents: 2375
diff changeset
    67
            self._ui.warn(_('warning: %s\n') % msg)
2364
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    68
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    69
    def _remove_file(self, name):
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    70
        relative_name = self._relative_name(name)
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    71
        # dirstate.state() requires a path relative to the root
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    72
        # directory.
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    73
        if self._repo.dirstate.state(relative_name) != '?':
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    74
            return
2378
6e5d40ec862d Removed --nothing, added --print and --print0
Marco Barisione <marco@barisione.org>
parents: 2377
diff changeset
    75
        self._ui.note(_('Removing file %s\n') % name)
2364
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    76
        if self._act:
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    77
            try:
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    78
                os.remove(name)
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    79
            except OSError, e:
2376
52cfb9864257 Marked strings for translation
Marco Barisione <marco@barisione.org>
parents: 2375
diff changeset
    80
                self._error(_('%s cannot be removed') % name)
2378
6e5d40ec862d Removed --nothing, added --print and --print0
Marco Barisione <marco@barisione.org>
parents: 2377
diff changeset
    81
        else:
6e5d40ec862d Removed --nothing, added --print and --print0
Marco Barisione <marco@barisione.org>
parents: 2377
diff changeset
    82
            self._ui.write('%s%s' % (name, self._eol))
2364
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    83
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    84
    def _remove_dir(self, name):
2378
6e5d40ec862d Removed --nothing, added --print and --print0
Marco Barisione <marco@barisione.org>
parents: 2377
diff changeset
    85
        self._ui.note(_('Removing directory %s\n') % name)
2364
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    86
        if self._act:
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    87
            try:
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    88
                os.rmdir(name)
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    89
            except OSError, e:
2376
52cfb9864257 Marked strings for translation
Marco Barisione <marco@barisione.org>
parents: 2375
diff changeset
    90
                self._error(_('%s cannot be removed') % name)
2378
6e5d40ec862d Removed --nothing, added --print and --print0
Marco Barisione <marco@barisione.org>
parents: 2377
diff changeset
    91
        else:
6e5d40ec862d Removed --nothing, added --print and --print0
Marco Barisione <marco@barisione.org>
parents: 2377
diff changeset
    92
            self._ui.write('%s%s' % (name, self._eol))
2364
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    93
2375
9f4f77693890 Added some comments
Marco Barisione <marco@barisione.org>
parents: 2374
diff changeset
    94
    def _relative_name(self, path):
9f4f77693890 Added some comments
Marco Barisione <marco@barisione.org>
parents: 2374
diff changeset
    95
        '''
9f4f77693890 Added some comments
Marco Barisione <marco@barisione.org>
parents: 2374
diff changeset
    96
        Returns "path" but relative to the root directory of the
9f4f77693890 Added some comments
Marco Barisione <marco@barisione.org>
parents: 2374
diff changeset
    97
        repository and with '\\' replaced with '/'.
9f4f77693890 Added some comments
Marco Barisione <marco@barisione.org>
parents: 2374
diff changeset
    98
        This is needed because this is the format required by
9f4f77693890 Added some comments
Marco Barisione <marco@barisione.org>
parents: 2374
diff changeset
    99
        self._repo.dirstate.state().
9f4f77693890 Added some comments
Marco Barisione <marco@barisione.org>
parents: 2374
diff changeset
   100
        '''
9f4f77693890 Added some comments
Marco Barisione <marco@barisione.org>
parents: 2374
diff changeset
   101
        splitted_path = self._split_path(path)[len(self._hg_root):]
2374
ffc2ed61061b Even on Windows self._repo.dirstate.state() wants '/' in paths
demian@gaudron.lan
parents: 2373
diff changeset
   102
        # Even on Windows self._repo.dirstate.state() wants '/'.
ffc2ed61061b Even on Windows self._repo.dirstate.state() wants '/' in paths
demian@gaudron.lan
parents: 2373
diff changeset
   103
        return self._join_path(splitted_path).replace('\\', '/')
2364
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
   104
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
   105
    def _split_path(self, path):
2375
9f4f77693890 Added some comments
Marco Barisione <marco@barisione.org>
parents: 2374
diff changeset
   106
        '''
2381
ab7a438294fc Rewritten install instructions for hg-purge to match new situation, fixed typos.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2379
diff changeset
   107
        Returns a list of the single files/directories in "path".
2375
9f4f77693890 Added some comments
Marco Barisione <marco@barisione.org>
parents: 2374
diff changeset
   108
        For instance:
9f4f77693890 Added some comments
Marco Barisione <marco@barisione.org>
parents: 2374
diff changeset
   109
          '/home/user/test' -> ['/', 'home', 'user', 'test']
9f4f77693890 Added some comments
Marco Barisione <marco@barisione.org>
parents: 2374
diff changeset
   110
          'C:\\Mercurial'   -> ['C:\\', 'Mercurial']
9f4f77693890 Added some comments
Marco Barisione <marco@barisione.org>
parents: 2374
diff changeset
   111
        '''
2364
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
   112
        ret = []
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
   113
        while True:
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
   114
            head, tail = os.path.split(path)
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
   115
            if tail:
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
   116
                ret.append(tail)
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
   117
            if head == path:
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
   118
                ret.append(head)
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
   119
                break
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
   120
            path = head
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
   121
        ret.reverse()
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
   122
        return ret
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
   123
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
   124
    def _join_path(self, splitted_path):
2375
9f4f77693890 Added some comments
Marco Barisione <marco@barisione.org>
parents: 2374
diff changeset
   125
        '''
9f4f77693890 Added some comments
Marco Barisione <marco@barisione.org>
parents: 2374
diff changeset
   126
        Joins a list returned by _split_path().
9f4f77693890 Added some comments
Marco Barisione <marco@barisione.org>
parents: 2374
diff changeset
   127
        '''
2364
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
   128
        ret = ''
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
   129
        for part in splitted_path:
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
   130
            if ret:
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
   131
                ret = os.path.join(ret, part)
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
   132
            else:
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
   133
                ret = part
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
   134
        return ret
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
   135
2369
9da3dd62c827 Purge.from_command is now a function called purge
demian@gaudron.lan
parents: 2364
diff changeset
   136
2377
626779aba9bb The meaning of the directories on the command line is now explained correctly
Marco Barisione <marco@barisione.org>
parents: 2376
diff changeset
   137
def purge(ui, repo, *dirs, **opts):
2369
9da3dd62c827 Purge.from_command is now a function called purge
demian@gaudron.lan
parents: 2364
diff changeset
   138
    '''removes files not tracked by mercurial
9da3dd62c827 Purge.from_command is now a function called purge
demian@gaudron.lan
parents: 2364
diff changeset
   139
9da3dd62c827 Purge.from_command is now a function called purge
demian@gaudron.lan
parents: 2364
diff changeset
   140
    Delete files not known to mercurial, this is useful to test local and
9da3dd62c827 Purge.from_command is now a function called purge
demian@gaudron.lan
parents: 2364
diff changeset
   141
    uncommitted changes in the otherwise clean source tree.
9da3dd62c827 Purge.from_command is now a function called purge
demian@gaudron.lan
parents: 2364
diff changeset
   142
9da3dd62c827 Purge.from_command is now a function called purge
demian@gaudron.lan
parents: 2364
diff changeset
   143
    This means that purge will delete:
9da3dd62c827 Purge.from_command is now a function called purge
demian@gaudron.lan
parents: 2364
diff changeset
   144
     - Unknown files: files marked with "?" by "hg status"
2377
626779aba9bb The meaning of the directories on the command line is now explained correctly
Marco Barisione <marco@barisione.org>
parents: 2376
diff changeset
   145
     - Ignored files: files usually ignored by Mercurial because they match
626779aba9bb The meaning of the directories on the command line is now explained correctly
Marco Barisione <marco@barisione.org>
parents: 2376
diff changeset
   146
       a pattern in a ".hgignore" file
2381
ab7a438294fc Rewritten install instructions for hg-purge to match new situation, fixed typos.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2379
diff changeset
   147
     - Empty directories: in fact Mercurial ignores directories unless they
2369
9da3dd62c827 Purge.from_command is now a function called purge
demian@gaudron.lan
parents: 2364
diff changeset
   148
       contain files under source control managment
9da3dd62c827 Purge.from_command is now a function called purge
demian@gaudron.lan
parents: 2364
diff changeset
   149
    But it will leave untouched:
9da3dd62c827 Purge.from_command is now a function called purge
demian@gaudron.lan
parents: 2364
diff changeset
   150
     - Unmodified tracked files
9da3dd62c827 Purge.from_command is now a function called purge
demian@gaudron.lan
parents: 2364
diff changeset
   151
     - Modified tracked files
9da3dd62c827 Purge.from_command is now a function called purge
demian@gaudron.lan
parents: 2364
diff changeset
   152
     - New files added to the repository (with "hg add")
2364
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
   153
2377
626779aba9bb The meaning of the directories on the command line is now explained correctly
Marco Barisione <marco@barisione.org>
parents: 2376
diff changeset
   154
    If directories are given on the command line, only files in these
626779aba9bb The meaning of the directories on the command line is now explained correctly
Marco Barisione <marco@barisione.org>
parents: 2376
diff changeset
   155
    directories are considered.
2364
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
   156
2369
9da3dd62c827 Purge.from_command is now a function called purge
demian@gaudron.lan
parents: 2364
diff changeset
   157
    Be careful with purge, you could irreversibly delete some files you
9da3dd62c827 Purge.from_command is now a function called purge
demian@gaudron.lan
parents: 2364
diff changeset
   158
    forgot to add to the repository. If you only want to print the list of
2381
ab7a438294fc Rewritten install instructions for hg-purge to match new situation, fixed typos.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2379
diff changeset
   159
    files that this program would delete use the --print option.
2369
9da3dd62c827 Purge.from_command is now a function called purge
demian@gaudron.lan
parents: 2364
diff changeset
   160
    '''
2378
6e5d40ec862d Removed --nothing, added --print and --print0
Marco Barisione <marco@barisione.org>
parents: 2377
diff changeset
   161
    act = not opts['print']
2370
de893ad6bd17 Command line options are read in a saner way
demian@gaudron.lan
parents: 2369
diff changeset
   162
    abort_on_err = bool(opts['abort_on_err'])
2378
6e5d40ec862d Removed --nothing, added --print and --print0
Marco Barisione <marco@barisione.org>
parents: 2377
diff changeset
   163
    eol = opts['print0'] and '\0' or '\n'
6e5d40ec862d Removed --nothing, added --print and --print0
Marco Barisione <marco@barisione.org>
parents: 2377
diff changeset
   164
    if eol == '\0':
6e5d40ec862d Removed --nothing, added --print and --print0
Marco Barisione <marco@barisione.org>
parents: 2377
diff changeset
   165
        # --print0 implies --print
6e5d40ec862d Removed --nothing, added --print and --print0
Marco Barisione <marco@barisione.org>
parents: 2377
diff changeset
   166
        act = False
6e5d40ec862d Removed --nothing, added --print and --print0
Marco Barisione <marco@barisione.org>
parents: 2377
diff changeset
   167
    p = Purge(act, abort_on_err, eol)
2377
626779aba9bb The meaning of the directories on the command line is now explained correctly
Marco Barisione <marco@barisione.org>
parents: 2376
diff changeset
   168
    p.purge(ui, repo, dirs)
2364
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
   169
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
   170
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
   171
cmdtable = {
2382
b429566d1994 Make indentation of purge's cmdtable match to mercurial/commands.py
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2381
diff changeset
   172
    'purge':
b429566d1994 Make indentation of purge's cmdtable match to mercurial/commands.py
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2381
diff changeset
   173
        (purge,
b429566d1994 Make indentation of purge's cmdtable match to mercurial/commands.py
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2381
diff changeset
   174
         [('a', 'abort-on-err', None, _('abort if an error occurs')),
b429566d1994 Make indentation of purge's cmdtable match to mercurial/commands.py
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2381
diff changeset
   175
          ('p', 'print', None, _('print the file names instead of deleting them')),
b429566d1994 Make indentation of purge's cmdtable match to mercurial/commands.py
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2381
diff changeset
   176
          ('0', 'print0', None, _('end filenames with NUL, for use with xargs'
b429566d1994 Make indentation of purge's cmdtable match to mercurial/commands.py
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2381
diff changeset
   177
                                  ' (implies -p)'))],
b429566d1994 Make indentation of purge's cmdtable match to mercurial/commands.py
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2381
diff changeset
   178
         _('hg purge [OPTION]... [DIR]...'))
2364
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
   179
}