~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/clean_tree.py

  • Committer: Shannon Weyrick
  • Date: 2011-11-04 13:40:04 UTC
  • mfrom: (6238 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6256.
  • Revision ID: weyrick@mozek.us-20111104134004-033t2wqhc3ydzm0a
Merge

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
import shutil
21
21
 
22
22
from bzrlib import (
23
 
    bzrdir,
 
23
    controldir,
24
24
    errors,
25
25
    ui,
26
26
    )
63
63
            return 0
64
64
        if not no_prompt:
65
65
            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'
 
66
                ui.ui_factory.note(subp)
 
67
            prompt = gettext('Are you sure you wish to delete these')
 
68
            if not ui.ui_factory.get_boolean(prompt):
 
69
                ui.ui_factory.note(gettext('Canceled'))
72
70
                return 0
73
71
        delete_items(deletables, dry_run=dry_run)
74
72
    finally:
85
83
        # directory and therefore delete it. (worth to FIXME?)
86
84
        if isdir(path):
87
85
            try:
88
 
                bzrdir.BzrDir.open(path)
 
86
                controldir.ControlDir.open(path)
89
87
            except errors.NotBranchError:
90
88
                result.append((path,subp))
91
89
            else: