hgext/purge.py
changeset 26587 56b2bcea2529
parent 26421 4b0fc75f9403
child 28382 27996f78a64c
equal deleted inserted replaced
26586:d51c658d3f04 26587:56b2bcea2529
    22 # You should have received a copy of the GNU General Public License
    22 # You should have received a copy of the GNU General Public License
    23 # along with this program; if not, see <http://www.gnu.org/licenses/>.
    23 # along with this program; if not, see <http://www.gnu.org/licenses/>.
    24 
    24 
    25 '''command to delete untracked files from the working directory'''
    25 '''command to delete untracked files from the working directory'''
    26 
    26 
    27 from mercurial import util, commands, cmdutil, scmutil
    27 from mercurial import util, commands, cmdutil, scmutil, error
    28 from mercurial.i18n import _
    28 from mercurial.i18n import _
    29 import os
    29 import os
    30 
    30 
    31 cmdtable = {}
    31 cmdtable = {}
    32 command = cmdutil.command(cmdtable)
    32 command = cmdutil.command(cmdtable)
    92             try:
    92             try:
    93                 remove_func(repo.wjoin(name))
    93                 remove_func(repo.wjoin(name))
    94             except OSError:
    94             except OSError:
    95                 m = _('%s cannot be removed') % name
    95                 m = _('%s cannot be removed') % name
    96                 if opts['abort_on_err']:
    96                 if opts['abort_on_err']:
    97                     raise util.Abort(m)
    97                     raise error.Abort(m)
    98                 ui.warn(_('warning: %s\n') % m)
    98                 ui.warn(_('warning: %s\n') % m)
    99         else:
    99         else:
   100             ui.write('%s%s' % (name, eol))
   100             ui.write('%s%s' % (name, eol))
   101 
   101 
   102     match = scmutil.match(repo[None], dirs, opts)
   102     match = scmutil.match(repo[None], dirs, opts)