~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/clean_tree.py

(jr) Add gettext() to uses of note() (Jonathan Riddell)

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
 
 
 
30
from bzrlib.i18n import gettext
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('Nothing to delete.')
 
62
            note(gettext('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('unable to remove %s' % path)
 
108
        ui.ui_factory.show_warning(gettext('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("deleting paths:")
 
112
            note(gettext("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(
126
 
                        'unable to remove "%s": %s.' % (path, e.strerror))
 
125
                    ui.ui_factory.show_warning(gettext(
 
126
                        'unable to remove "%s": %s.') % (path, e.strerror))
127
127
        else:
128
128
            note('  ' + subp)
129
129
    if not has_deleted:
130
 
        note("No files deleted.")
 
130
        note(gettext("No files deleted."))