~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/clean_tree.py

  • Committer: Patch Queue Manager
  • Date: 2013-05-20 17:46:29 UTC
  • mfrom: (6573.1.1 bzr)
  • Revision ID: pqm@pqm.ubuntu.com-20130520174629-dp7zujtuclvomuzd
(jameinel) Fix CVE 2013-2009. Avoid allowing multiple wildcards in a single
 SSL cert hostname segment. (Andrew Starr-Bochicchio)

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
 
17
from __future__ import absolute_import
17
18
 
18
19
import errno
19
20
import os
20
21
import shutil
21
22
 
22
23
from bzrlib import (
23
 
    bzrdir,
 
24
    controldir,
24
25
    errors,
25
26
    ui,
26
27
    )
63
64
            return 0
64
65
        if not no_prompt:
65
66
            for path, subp in deletables:
66
 
                # FIXME using print is very bad idea
67
 
                # clean_tree should accept to_file argument to write the output
68
 
                print subp
69
 
            val = raw_input('Are you sure you wish to delete these [y/N]?')
70
 
            if val.lower() not in ('y', 'yes'):
71
 
                print 'Canceled'
 
67
                ui.ui_factory.note(subp)
 
68
            prompt = gettext('Are you sure you wish to delete these')
 
69
            if not ui.ui_factory.get_boolean(prompt):
 
70
                ui.ui_factory.note(gettext('Canceled'))
72
71
                return 0
73
72
        delete_items(deletables, dry_run=dry_run)
74
73
    finally:
85
84
        # directory and therefore delete it. (worth to FIXME?)
86
85
        if isdir(path):
87
86
            try:
88
 
                bzrdir.BzrDir.open(path)
 
87
                controldir.ControlDir.open(path)
89
88
            except errors.NotBranchError:
90
89
                result.append((path,subp))
91
90
            else: