~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/clean_tree.py

  • Committer: Martin von Gagern
  • Date: 2011-06-01 12:53:56 UTC
  • mto: This revision was merged to the branch mainline in revision 6009.
  • Revision ID: martin.vgagern@gmx.net-20110601125356-lwozv2vecea6hxfz
Change from no_decorate to classify as name for the argument.

The command line switch remains as --no-classify, to keep backwards
compatibility.  Users are free to include --no-classify in an alias, and
still use --classify to change back.

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
from bzrlib.osutils import isdir
28
28
from bzrlib.trace import note
29
29
from bzrlib.workingtree import WorkingTree
30
 
from bzrlib.i18n import gettext
 
30
 
31
31
 
32
32
def is_detritus(subp):
33
33
    """Return True if the supplied path is detritus, False otherwise"""
59
59
            ignored=ignored, detritus=detritus))
60
60
        deletables = _filter_out_nested_bzrdirs(deletables)
61
61
        if len(deletables) == 0:
62
 
            note(gettext('Nothing to delete.'))
 
62
            note('Nothing to delete.')
63
63
            return 0
64
64
        if not no_prompt:
65
65
            for path, subp in deletables:
105
105
        # Other errors are re-raised.
106
106
        if function is not os.remove or excinfo[1].errno != errno.EACCES:
107
107
            raise
108
 
        ui.ui_factory.show_warning(gettext('unable to remove %s') % path)
 
108
        ui.ui_factory.show_warning('unable to remove %s' % path)
109
109
    has_deleted = False
110
110
    for path, subp in deletables:
111
111
        if not has_deleted:
112
 
            note(gettext("deleting paths:"))
 
112
            note("deleting paths:")
113
113
            has_deleted = True
114
114
        if not dry_run:
115
115
            if isdir(path):
122
122
                    # We handle only permission error here
123
123
                    if e.errno != errno.EACCES:
124
124
                        raise e
125
 
                    ui.ui_factory.show_warning(gettext(
126
 
                        'unable to remove "{0}": {1}.').format(
127
 
                                                    path, e.strerror))
 
125
                    ui.ui_factory.show_warning(
 
126
                        'unable to remove "%s": %s.' % (path, e.strerror))
128
127
        else:
129
128
            note('  ' + subp)
130
129
    if not has_deleted:
131
 
        note(gettext("No files deleted."))
 
130
        note("No files deleted.")